﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Services;
using XWG.JWBST.JWBSTEntity;
using XWG.JWBST.JWBSTBLL;
using Newtonsoft.Json.Converters;
using Newtonsoft.Json;
using XWG.Framework.AuthUtility;
using System.Data;
using XWG.Framework;
using XWG.JWBST.JWBSTSPConst;
using XWG.Framework.AuthDAL;
using XWG.Framework.MSException;
using JWBST.CommonClass;
using System.Collections;
using JWBSTAPP.CommonClass;
using Newtonsoft.Json.Linq;
using System.Text.RegularExpressions;

namespace XWG.JWBST.JWBSTManagementApp
{
    /// <summary>
    /// ServiceHandler 的摘要说明
    /// </summary>
    public class ServiceHandler : JWBSTAPP.CommonClass.WebHandlerBase, System.Web.SessionState.IRequiresSessionState
    {
        #region 测试
        [WebMethod]
        public void addLoginId()
        {
            HttpContext context = HttpContext.Current;
            string callback = HttpContext.Current.Request["para"];
            var tm = TbBstOnlineAskBLL.SelectList();
            IsoDateTimeConverter dtConverter = new IsoDateTimeConverter { DateTimeFormat = "yyyy-MM-dd HH:mm:ss" };
            //HttpContext.Current.Response.Charset = "GB2312";
            //HttpContext.Current.Response.ContentEncoding = System.Text.Encoding.GetEncoding("GB2312"); 
            AjaxResultModel mResultModel = new AjaxResultModel(); //初始化返回类型
            mResultModel.result = "ok";
            mResultModel.data = tm;
            mResultModel.totalCount = -1;
            mResultModel.pageCount = -1;
            HttpContext.Current.Response.ContentEncoding = System.Text.Encoding.GetEncoding("GB2312");
            var result = JsonUtils.ConvertJsonString(JsonConvert.SerializeObject(mResultModel, dtConverter));
            HttpContext.Current.Response.Write(callback + "(" + result + ")");
            HttpContext.Current.Response.End();
        }
        #endregion

        #region  通缉协查 举报线索-添加接口

        /// <summary>
        /// 通缉协查 举报线索
        /// </summary>
        [WebMethod]
        public void AddWantedLues()
        {
            object filedkey;
            string callback = HttpContext.Current.Request["para"];
            string wantedname = DES.Encode(HttpContext.Current.Request["wantedname"].FilteHtml()); ////涉及人员
            string name = DES.Encode(HttpContext.Current.Request["name"].FilteHtml());////本人姓名
            string phone = DES.Encode(HttpContext.Current.Request["phone"].FilteHtml());////手机号
            string email = DES.Encode(HttpContext.Current.Request["email"].FilteHtml());////邮箱
            string address = DES.Encode(HttpContext.Current.Request["address"].FilteHtml());////地址
            string content = HttpContext.Current.Request["content"].FilteHtml();////内容
            AjaxResultModel mResultModel = new AjaxResultModel(); //初始化返回类型
            TbBstWantedWire mTbBstWantedWire = new TbBstWantedWire();
            try
            {
                mTbBstWantedWire.Id = Guid.NewGuid().ToString(); //主键
                mTbBstWantedWire.Wantedname = wantedname; ////涉及人员
                mTbBstWantedWire.Name = name; ////本人姓名
                mTbBstWantedWire.Phone = phone; ////手机号
                mTbBstWantedWire.Email = email; ////邮箱
                mTbBstWantedWire.Address = address; ////地址
                mTbBstWantedWire.Content = content; ////内容
                mTbBstWantedWire.Createdate = DateTime.Now;//信息添加时间
                mTbBstWantedWire.Deltag = 0; //删除标志0未删除1已删除
                filedkey = Db.TransInsert<TbBstWantedWire>(mTbBstWantedWire);
                mResultModel.result = "ok";
                mResultModel.data = mTbBstWantedWire;
            }
            catch (Exception ex)
            {
                MSEx.DealErr(ex, "实体类的插入操作");
                mResultModel.result = "error";
            }
            IsoDateTimeConverter dtConverter = new IsoDateTimeConverter { DateTimeFormat = "yyyy-MM-dd HH:mm:ss" };
            HttpContext.Current.Response.ContentEncoding = System.Text.Encoding.GetEncoding("GB2312");
            var result = JsonUtils.ConvertJsonString(JsonConvert.SerializeObject(mResultModel, dtConverter));
            HttpContext.Current.Response.Write(callback + "(" + result + ")");
            HttpContext.Current.Response.End();
        }
        #endregion

        #region 走失人口 提供线索-添加接口

        /// <summary>
        /// 走失人口 提供线索
        /// </summary>
        [WebMethod]
        public void AddLostmanLues()
        {
            object filedkey;
            string callback = HttpContext.Current.Request["para"];
            string lostname = DES.Encode(HttpContext.Current.Request["lostname"].FilteHtml()); ////涉及人员
            string name = DES.Encode(HttpContext.Current.Request["name"].FilteHtml());////本人姓名
            string phone = DES.Encode(HttpContext.Current.Request["phone"].FilteHtml());////手机号
            string email = DES.Encode(HttpContext.Current.Request["email"].FilteHtml());////邮箱
            string address = DES.Encode(HttpContext.Current.Request["address"].FilteHtml());////地址
            string content = HttpContext.Current.Request["content"].FilteHtml();////内容
            AjaxResultModel mResultModel = new AjaxResultModel(); //初始化返回类型
            TbBstLostmanWire mTbBstLostmanWire = new TbBstLostmanWire();
            try
            {
                mTbBstLostmanWire.Id = Guid.NewGuid().ToString(); //主键
                mTbBstLostmanWire.Lostname = lostname; ////涉及人员
                mTbBstLostmanWire.Name = name; ////本人姓名
                mTbBstLostmanWire.Phone = phone; ////手机号
                mTbBstLostmanWire.Email = email; ////邮箱
                mTbBstLostmanWire.Address = address; ////地址
                mTbBstLostmanWire.Content = content; ////内容
                mTbBstLostmanWire.Createdate = DateTime.Now;//信息添加时间
                mTbBstLostmanWire.Deltag = 0; //删除标志0未删除1已删除
                filedkey = Db.TransInsert<TbBstLostmanWire>(mTbBstLostmanWire);
                mResultModel.result = "ok";
                mResultModel.data = mTbBstLostmanWire;
            }
            catch (Exception ex)
            {
                MSEx.DealErr(ex, "实体类的插入操作");
                mResultModel.result = "error";
            }
            IsoDateTimeConverter dtConverter = new IsoDateTimeConverter { DateTimeFormat = "yyyy-MM-dd HH:mm:ss" };
            HttpContext.Current.Response.ContentEncoding = System.Text.Encoding.GetEncoding("GB2312");
            var result = JsonUtils.ConvertJsonString(JsonConvert.SerializeObject(mResultModel, dtConverter));
            HttpContext.Current.Response.Write(callback + "(" + result + ")");
            HttpContext.Current.Response.End();
        }
        #endregion

        #region 走失人口 发布走失人口信息-添加接口

        /// <summary>
        /// 走失人口 发布走失人口信息
        /// </summary>
        [WebMethod]
        public void AddLostmanInfo()
        {
            object filedkey;
            DateTime birth = Convert.ToDateTime("0000-00-00");
            string callback = HttpContext.Current.Request["para"];
            string name = DES.Encode(HttpContext.Current.Request["name"].FilteHtml()); ////走失人员姓名
            string gender = HttpContext.Current.Request["gender"];////走失人性别
            if (!string.IsNullOrEmpty(HttpContext.Current.Request["birth"]))
            {
                birth = DateTime.Parse(HttpContext.Current.Request["birth"]);////走失人出生日期
            }
            // string birth = HttpContext.Current.Request["birth"]; //出生日期
            string idcard = DES.Encode(HttpContext.Current.Request["idcard"].FilteHtml());////走失人身份证号
            string note = HttpContext.Current.Request["note"].FilteHtml();////走失经过
            string issuename = DES.Encode(HttpContext.Current.Request["issuename"].FilteHtml());////发布人姓名
            string issuephone = DES.Encode(HttpContext.Current.Request["issuephone"].FilteHtml());////发布人手机号
            string issueidcard = DES.Encode(HttpContext.Current.Request["issueidcard"].FilteHtml());////发布人身份证号
            string issueaddress = DES.Encode(HttpContext.Current.Request["issueaddress"].FilteHtml());////发布人联系地址
            // string pic = HttpContext.Current.Request["pic"];////走失人照片（照片提交方式待定，找刘冬）
            AjaxResultModel mResultModel = new AjaxResultModel(); //初始化返回类型
            TbBstLostman mTbBstLostman = new TbBstLostman();
            try
            {
                mTbBstLostman.Id = Guid.NewGuid().ToString(); //主键
                mTbBstLostman.Name = name; ////走失人姓名
                mTbBstLostman.Gender = gender; ////走失人性别
                if (!string.IsNullOrEmpty(birth.ToString()))
                {
                    mTbBstLostman.Birth = birth; ////走失人出生年月
                }
                mTbBstLostman.Idcard = idcard; ////走失人身份证
                mTbBstLostman.Note = note; ////走失经过描述
                mTbBstLostman.Issuename = issuename; ////发布人姓名
                mTbBstLostman.Idcard = issueidcard; ////发布人身份证号
                mTbBstLostman.Issuenphone = issuephone; ////发布人手机
                mTbBstLostman.Issuename = issueaddress; ////发布人联系地址
                mTbBstLostman.Createdate = DateTime.Now;//信息添加时间
                mTbBstLostman.Deltag = 0; //删除标志0未删除1已删除
                filedkey = Db.TransInsert<TbBstLostman>(mTbBstLostman);
                mResultModel.result = "ok";
                mResultModel.data = mTbBstLostman;
            }
            catch (Exception ex)
            {
                MSEx.DealErr(ex, "实体类的插入操作");
                mResultModel.result = "error";
            }
            IsoDateTimeConverter dtConverter = new IsoDateTimeConverter { DateTimeFormat = "yyyy-MM-dd HH:mm:ss" };
            HttpContext.Current.Response.ContentEncoding = System.Text.Encoding.GetEncoding("GB2312");
            var result = JsonUtils.ConvertJsonString(JsonConvert.SerializeObject(mResultModel, dtConverter));
            HttpContext.Current.Response.Write(callback + "(" + result + ")");
            HttpContext.Current.Response.End();
        }
        #endregion

        #region 网上咨询-添加接口
        /// <summary>
        /// 网上咨询添加
        /// </summary>
        [WebMethod]
        public void AddOnlineAsk()
        {
            object filedkey;
            string callback = HttpContext.Current.Request["para"];
            string name = DES.Encode(HttpContext.Current.Request["name"].FilteHtml());////姓名
            string phone = DES.Encode(HttpContext.Current.Request["phone"].FilteHtml());////手机号
            string psd = HttpContext.Current.Request["psd"].FilteHtml();////查询密码
            string policekind = HttpContext.Current.Request["policekind"].FilteHtml();////警种
            string ispublic = HttpContext.Current.Request["ispublic"].FilteHtml();////是否公开
            string content = HttpContext.Current.Request["content"].FilteHtml();////内容
            AjaxResultModel mResultModel = new AjaxResultModel(); //初始化返回类型
            TbBstOnlineAsk mTbBstOnlineAsk = new TbBstOnlineAsk();
            try
            {
                mTbBstOnlineAsk.Id = Guid.NewGuid().ToString(); //主键
                mTbBstOnlineAsk.Content = content; ////内容
                mTbBstOnlineAsk.Name = name; ////姓名
                mTbBstOnlineAsk.Psd = psd; ////查询密码
                mTbBstOnlineAsk.Phone = phone;
                mTbBstOnlineAsk.Category = policekind; ////警种
                mTbBstOnlineAsk.Createdate = DateTime.Now;//信息添加时间
                mTbBstOnlineAsk.Ispublic = ispublic;////是否公开
                mTbBstOnlineAsk.Deltag = 0; //删除标志0未删除1已删除
                mTbBstOnlineAsk.Movesign = "1";
                mTbBstOnlineAsk.Lsh = JWBSTBLL.TbBstFastprocessBLL.GetLSH("TB_BST_ONLINE_ASK");//流水号
                filedkey = Db.TransInsert<TbBstOnlineAsk>(mTbBstOnlineAsk);
                mResultModel.result = "ok";
                mResultModel.data = mTbBstOnlineAsk;
            }
            catch (Exception ex)
            {
                MSEx.DealErr(ex, "实体类的插入操作" + ex.Message.ToString());
                mResultModel.result = "error";
            }
            IsoDateTimeConverter dtConverter = new IsoDateTimeConverter { DateTimeFormat = "yyyy-MM-dd HH:mm:ss" };
            HttpContext.Current.Response.ContentEncoding = System.Text.Encoding.GetEncoding("GB2312");
            var result = JsonUtils.ConvertJsonString(JsonConvert.SerializeObject(mResultModel, dtConverter));
            HttpContext.Current.Response.Write(callback + "(" + result + ")");
            HttpContext.Current.Response.End();
        }
        #endregion

        #region 网上咨询-个人查询
        /// <summary>
        /// 网上咨询-个人查询
        /// </summary>
        [WebMethod]
        public void GetOnlineAskList()
        {
            AjaxResultModel mResultModel = new AjaxResultModel(); //初始化返回类型
            string callback = HttpContext.Current.Request["para"];
            try
            {
                int pageSize = 20;
                int pageIndex = 1;
                if (!string.IsNullOrEmpty(HttpContext.Current.Request["pageSize"]))
                {
                    pageSize = Convert.ToInt32(HttpContext.Current.Request["pageSize"]);
                }
                if (pageSize > 30)
                {
                    pageSize = 30;
                }
                if (!string.IsNullOrEmpty(HttpContext.Current.Request["pageIndex"]))
                {
                    pageIndex = Convert.ToInt32(HttpContext.Current.Request["pageIndex"]);
                }
                string phone = DES.Encode(HttpContext.Current.Request["phone"].FilteHtml());
                string psd = HttpContext.Current.Request["psd"].FilteHtml();
                TbBstOnlineAsk mTbBstOnlineAsk = new TbBstOnlineAsk();
                DataTable dtTbBstOnlineAsk = new DataTable();
                QueryByPage Q = new QueryByPage();
                SqlConditionList sqllist = new SqlConditionList();
                string sqlWhere = " deltag = 0 ";
                if (!string.IsNullOrEmpty(phone)) ////手机号
                {
                    sqllist.AddLogic(new SqlConditionList.SqlCondition(SqlCompareOper.EQUAL, TbBstOnlineAskConst.Columns.Phone, phone), SqlLogicOper.AND_LOGIC);
                }
                if (!string.IsNullOrEmpty(psd)) ////密码
                {
                    sqllist.AddLogic(new SqlConditionList.SqlCondition(SqlCompareOper.EQUAL, TbBstOnlineAskConst.Columns.Psd, psd), SqlLogicOper.AND_LOGIC);
                }
                if (string.IsNullOrEmpty(sqllist.ToSql()))
                {
                    sqlWhere = "where" + sqlWhere;
                }
                else
                {
                    sqlWhere = sqllist.ToSql() + " and " + sqlWhere;
                }
                dtTbBstOnlineAsk = Q.GetRecordByPage("*", sqlWhere, " createdate ", pageSize, pageIndex, TbBstOnlineAskConst.QTableName, TbBstOnlineAskConst.FieldKey, "desc").Tables[0];
                if (dtTbBstOnlineAsk != null && dtTbBstOnlineAsk.Rows.Count > -1)
                {
                    mResultModel.result = "ok";
                    mResultModel.totalCount = dtTbBstOnlineAsk.Rows.Count;
                    ////解密部分加密字段
                    for (int i = 0; i < dtTbBstOnlineAsk.Rows.Count; i++)
                    {
                        dtTbBstOnlineAsk.Rows[i][TbBstOnlineAskConst.Columns.Phone] = DES.Decode(dtTbBstOnlineAsk.Rows[i][TbBstOnlineAskConst.Columns.Phone].ToString());
                        dtTbBstOnlineAsk.Rows[i][TbBstOnlineAskConst.Columns.Name] = DES.Decode(dtTbBstOnlineAsk.Rows[i][TbBstOnlineAskConst.Columns.Name].ToString());
                    }
                    mResultModel.data = dtTbBstOnlineAsk;
                }
                else
                {
                    mResultModel.result = "error";
                    mResultModel.ErrorCode = -112;
                }
            }
            catch (Exception e)
            {
                mResultModel.result = "error";
            }
            IsoDateTimeConverter dtConverter = new IsoDateTimeConverter { DateTimeFormat = "yyyy-MM-dd HH:mm:ss" };
            HttpContext.Current.Response.Charset = "GB2312";
            HttpContext.Current.Response.ContentEncoding = System.Text.Encoding.GetEncoding("GB2312");
            var result = JsonUtils.ConvertJsonString(JsonConvert.SerializeObject(mResultModel, dtConverter));
            HttpContext.Current.Response.Write(callback + "(" + result + ")");
            var str = JsonConvert.SerializeObject(mResultModel, dtConverter);
            HttpContext.Current.Response.End();
        }
        #endregion

        #region 网上咨询-全部查询
        /// <summary>
        /// 网上咨询-全部查询
        /// </summary>
        [WebMethod]
        public void GetOnlineAskAllList()
        {
            AjaxResultModel mResultModel = new AjaxResultModel(); //初始化返回类型
            TbBstOnlineAsk mTbBstOnlineAsk = new TbBstOnlineAsk();
            string callback = HttpContext.Current.Request["para"];
            try
            {
                int pageSize = 20;
                int pageIndex = 1;
                if (!string.IsNullOrEmpty(HttpContext.Current.Request["pageSize"]))
                {
                    pageSize = Convert.ToInt32(HttpContext.Current.Request["pageSize"]);
                }
                if (pageSize > 30)
                {
                    pageSize = 30;
                }
                if (!string.IsNullOrEmpty(HttpContext.Current.Request["pageIndex"]))
                {
                    pageIndex = Convert.ToInt32(HttpContext.Current.Request["pageIndex"]);
                }
                string policekind = HttpContext.Current.Request["policekind"].FilteHtml();
                string keyword = HttpContext.Current.Request["kword"].FilteHtml();
                DataTable dtTbBstOnlineAsk = new DataTable();
                QueryByPage Q = new QueryByPage();
                SqlConditionList sqllist = new SqlConditionList();
                string sqlWhere = " deltag = 0 and replysign=1 and auditsign=1 ";

                if (!string.IsNullOrEmpty(policekind)) ////警种 
                {
                    sqllist.AddLogic(new SqlConditionList.SqlCondition(SqlCompareOper.EQUAL, TbBstOnlineAskConst.Columns.Category, policekind.ToUpper()), SqlLogicOper.AND_LOGIC);
                }
                if (!string.IsNullOrEmpty(keyword))
                {
                    sqllist.AddLogic(new SqlConditionList.SqlCondition(SqlCompareOper.LIKE, TbBstOnlineAskConst.Columns.Content, '%' + keyword + '%'), SqlLogicOper.AND_LOGIC);
                }
                if (string.IsNullOrEmpty(sqllist.ToSql()))
                {
                    sqlWhere = "where" + sqlWhere;
                }
                else
                {
                    sqlWhere = sqllist.ToSql() + " and " + sqlWhere;
                }
                dtTbBstOnlineAsk = Q.GetRecordByPage("*", sqlWhere, " createdate ", pageSize, pageIndex, TbBstOnlineAskConst.QTableName, TbBstOnlineAskConst.FieldKey, "desc").Tables[0];
                if (dtTbBstOnlineAsk != null && dtTbBstOnlineAsk.Rows.Count > -1)
                {
                    mResultModel.result = "ok";
                    if (pageSize == 0)
                    {
                        mResultModel.totalCount = dtTbBstOnlineAsk.Rows.Count;
                    }
                    else
                    {
                        mResultModel.totalCount = (int)Q.RowCount;
                    }
                    //  mResultModel.pageCount = -1;
                    ////解密部分加密字段
                    for (int i = 0; i < dtTbBstOnlineAsk.Rows.Count; i++)
                    {
                        dtTbBstOnlineAsk.Rows[i][TbBstOnlineAskConst.Columns.Phone] = DES.Decode(dtTbBstOnlineAsk.Rows[i][TbBstOnlineAskConst.Columns.Phone].ToString());
                        dtTbBstOnlineAsk.Rows[i][TbBstOnlineAskConst.Columns.Name] = DES.Decode(dtTbBstOnlineAsk.Rows[i][TbBstOnlineAskConst.Columns.Name].ToString());
                    }
                    mResultModel.data = dtTbBstOnlineAsk;
                }
                else
                {
                    mResultModel.result = "error";
                    mResultModel.ErrorCode = -112;
                }
            }
            catch (Exception e)
            {
                mResultModel.result = "error";
            }
            IsoDateTimeConverter dtConverter = new IsoDateTimeConverter { DateTimeFormat = "yyyy-MM-dd HH:mm:ss" };
            HttpContext.Current.Response.Charset = "GB2312";
            HttpContext.Current.Response.ContentEncoding = System.Text.Encoding.GetEncoding("GB2312");
            var result = JsonUtils.ConvertJsonString(JsonConvert.SerializeObject(mResultModel, dtConverter));
            HttpContext.Current.Response.Write(callback + "(" + result + ")");
            HttpContext.Current.Response.End();
        }
        #endregion

        #region 常见问题列表
        /// <summary>
        /// 常见问题-全部查询
        /// </summary>
        [WebMethod]
        public void GetCustomAskAllList()
        {
            AjaxResultModel mResultModel = new AjaxResultModel(); //初始化返回类型
            TbBstOnlineAsk mTbBstOnlineAsk = new TbBstOnlineAsk();
            string callback = HttpContext.Current.Request["para"];
            try
            {
                int pageSize = 20;
                int pageIndex = 1;
                if (!string.IsNullOrEmpty(HttpContext.Current.Request["pageSize"]))
                {
                    pageSize = Convert.ToInt32(HttpContext.Current.Request["pageSize"]);
                }
                if (pageSize > 30)
                {
                    pageSize = 30;
                }
                if (!string.IsNullOrEmpty(HttpContext.Current.Request["pageIndex"]))
                {
                    pageIndex = Convert.ToInt32(HttpContext.Current.Request["pageIndex"]);
                }
                string policekind = HttpContext.Current.Request["policekind"].FilteHtml();
                string keyword = HttpContext.Current.Request["kword"].FilteHtml();
                DataTable dtTbBstOnlineAsk = new DataTable();
                QueryByPage Q = new QueryByPage();
                SqlConditionList sqllist = new SqlConditionList();
                string sqlWhere = " deltag = 0 and replysign=1 and auditsign=1 and iscjwt=1";

                if (!string.IsNullOrEmpty(policekind)) ////警种 
                {
                    sqllist.AddLogic(new SqlConditionList.SqlCondition(SqlCompareOper.EQUAL, TbBstOnlineAskConst.Columns.Category, policekind.ToUpper()), SqlLogicOper.AND_LOGIC);
                }
                if (!string.IsNullOrEmpty(keyword))
                {
                    sqllist.AddLogic(new SqlConditionList.SqlCondition(SqlCompareOper.LIKE, TbBstOnlineAskConst.Columns.Content, '%' + keyword + '%'), SqlLogicOper.AND_LOGIC);
                }
                if (string.IsNullOrEmpty(sqllist.ToSql()))
                {
                    sqlWhere = "where" + sqlWhere;
                }
                else
                {
                    sqlWhere = sqllist.ToSql() + " and " + sqlWhere;
                }
                dtTbBstOnlineAsk = Q.GetRecordByPage("*", sqlWhere, " createdate ", pageSize, pageIndex, TbBstOnlineAskConst.QTableName, TbBstOnlineAskConst.FieldKey, "desc").Tables[0];
                if (dtTbBstOnlineAsk != null && dtTbBstOnlineAsk.Rows.Count > -1)
                {
                    mResultModel.result = "ok";
                    if (pageSize == 0)
                    {
                        mResultModel.totalCount = dtTbBstOnlineAsk.Rows.Count;
                    }
                    else
                    {
                        mResultModel.totalCount = (int)Q.RowCount;
                    }
                    //  mResultModel.pageCount = -1;
                    ////解密部分加密字段
                    for (int i = 0; i < dtTbBstOnlineAsk.Rows.Count; i++)
                    {
                        dtTbBstOnlineAsk.Rows[i][TbBstOnlineAskConst.Columns.Phone] = DES.Decode(dtTbBstOnlineAsk.Rows[i][TbBstOnlineAskConst.Columns.Phone].ToString());
                        dtTbBstOnlineAsk.Rows[i][TbBstOnlineAskConst.Columns.Name] = DES.Decode(dtTbBstOnlineAsk.Rows[i][TbBstOnlineAskConst.Columns.Name].ToString());
                    }
                    mResultModel.data = dtTbBstOnlineAsk;
                }
                else
                {
                    mResultModel.result = "error";
                    mResultModel.ErrorCode = -112;
                }
            }
            catch (Exception e)
            {
                mResultModel.result = "error";
            }
            IsoDateTimeConverter dtConverter = new IsoDateTimeConverter { DateTimeFormat = "yyyy-MM-dd HH:mm:ss" };
            HttpContext.Current.Response.Charset = "GB2312";
            HttpContext.Current.Response.ContentEncoding = System.Text.Encoding.GetEncoding("GB2312");
            var result = JsonUtils.ConvertJsonString(JsonConvert.SerializeObject(mResultModel, dtConverter));
            HttpContext.Current.Response.Write(callback + "(" + result + ")");
            HttpContext.Current.Response.End();
        }
        #endregion

        #region 民意直通 局长信箱-添加接口

        /// <summary>
        /// 民意直通 局长信箱
        /// </summary>
        [WebMethod]
        public void AddDirectorLetter()
        {
            object filedkey;
            //var ip = HttpContext.Current.Request.UserHostAddress;
            var ip = GetWebClientIp();
            string callback = HttpContext.Current.Request["para"];
            string name = DES.Encode(HttpContext.Current.Request["name"].FilteHtml());////姓名
            string phone = DES.Encode(HttpContext.Current.Request["phone"].FilteHtml());////手机号
            string email = DES.Encode(HttpContext.Current.Request["email"].FilteHtml());////邮箱
            string address = DES.Encode(HttpContext.Current.Request["address"].FilteHtml());////地址
            string psd = HttpContext.Current.Request["psd"].FilteHtml();////查询密码
            string content = HttpContext.Current.Request["content"].FilteHtml();////内容
            AjaxResultModel mResultModel = new AjaxResultModel(); //初始化返回类型
            TbBstDirectorLetter mTbBstDirectorLetter = new TbBstDirectorLetter();
            try
            {
                mTbBstDirectorLetter.Id = Guid.NewGuid().ToString(); //主键
                mTbBstDirectorLetter.Lsh = XWG.JWBST.JWBSTBLL.TbBstFastprocessBLL.GetLSH("TB_BST_DIRECTOR_LETTER");
                mTbBstDirectorLetter.Name = name; ////本人姓名
                mTbBstDirectorLetter.Phone = phone; ////手机号
                mTbBstDirectorLetter.Email = email; ////邮箱
                mTbBstDirectorLetter.Address = address; ////地址
                mTbBstDirectorLetter.Content = content; ////内容
                mTbBstDirectorLetter.Ip = ip;
                mTbBstDirectorLetter.Psd = psd; ////密码
                mTbBstDirectorLetter.Createdate = DateTime.Now;//信息添加时间
                mTbBstDirectorLetter.Deltag = 0; //删除标志0未删除1已删除
                mTbBstDirectorLetter.Movesign = "1";
                mTbBstDirectorLetter.Replysign = "0";
                mTbBstDirectorLetter.Isview = "0";
                mTbBstDirectorLetter.Tabletype = "2";
                filedkey = Db.TransInsert<TbBstDirectorLetter>(mTbBstDirectorLetter);
                mResultModel.result = "ok";
                mResultModel.data = mTbBstDirectorLetter;
            }
            catch (Exception ex)
            {
                MSEx.DealErr(ex, "实体类的插入操作");
                mResultModel.result = "error";
            }
            IsoDateTimeConverter dtConverter = new IsoDateTimeConverter { DateTimeFormat = "yyyy-MM-dd HH:mm:ss" };
            HttpContext.Current.Response.ContentEncoding = System.Text.Encoding.GetEncoding("GB2312");
            var result = JsonUtils.ConvertJsonString(JsonConvert.SerializeObject(mResultModel, dtConverter));
            HttpContext.Current.Response.Write(callback + "(" + result + ")");
            HttpContext.Current.Response.End();
        }
        #endregion

        #region 民意直通 局长信箱-个人查询
        /// <summary>
        /// 民意直通 局长信箱-个人查询
        /// </summary>
        [WebMethod]
        public void GetDirectorLetterList()
        {
            AjaxResultModel mResultModel = new AjaxResultModel(); //初始化返回类型
            string callback = HttpContext.Current.Request["para"];
            try
            {
                int pageSize = 20;
                int pageIndex = 1;
                var replyContent = "";
                var replyName = "";
                var replyTime = "";
                if (!string.IsNullOrEmpty(HttpContext.Current.Request["pageSize"]))
                {
                    pageSize = Convert.ToInt32(HttpContext.Current.Request["pageSize"]);
                }
                if (pageSize > 30)
                {
                    pageSize = 30;
                }
                if (!string.IsNullOrEmpty(HttpContext.Current.Request["pageIndex"]))
                {
                    pageIndex = Convert.ToInt32(HttpContext.Current.Request["pageIndex"]);
                }
                string phone = DES.Encode(HttpContext.Current.Request["phone"].FilteHtml());
                string psd = HttpContext.Current.Request["psd"].FilteHtml();
                TbBstDirectorLetter mTbBstOnlineAsk = new TbBstDirectorLetter();
                DataTable dtTbBstDirectorLetter = new DataTable();
                QueryByPage Q = new QueryByPage();
                SqlConditionList sqllist = new SqlConditionList();
                string sqlWhere = " deltag = 0 ";
                if (!string.IsNullOrEmpty(phone)) ////手机号
                {
                    sqllist.AddLogic(new SqlConditionList.SqlCondition(SqlCompareOper.EQUAL, TbBstDirectorLetterConst.Columns.Phone, phone), SqlLogicOper.AND_LOGIC);
                }
                if (!string.IsNullOrEmpty(psd)) ////密码
                {
                    sqllist.AddLogic(new SqlConditionList.SqlCondition(SqlCompareOper.EQUAL, TbBstDirectorLetterConst.Columns.Psd, psd), SqlLogicOper.AND_LOGIC);
                }
                if (string.IsNullOrEmpty(sqllist.ToSql()))
                {
                    sqlWhere = "where" + sqlWhere;
                }
                else
                {
                    sqlWhere = sqllist.ToSql() + " and " + sqlWhere;
                }
                dtTbBstDirectorLetter = Q.GetRecordByPage("*", sqlWhere, " createdate ", pageSize, pageIndex, TbBstDirectorLetterConst.TableName, TbBstDirectorLetterConst.FieldKey, "desc").Tables[0];
                XWG.JWBST.JWBSTBLL.TbBstDirectorLetterBLL.updateView(phone, psd);
                if (dtTbBstDirectorLetter != null && dtTbBstDirectorLetter.Rows.Count > -1)
                {
                    dtTbBstDirectorLetter.Columns.Add(new DataColumn() { ColumnName = "replycontent" });
                    dtTbBstDirectorLetter.Columns.Add(new DataColumn() { ColumnName = "replyname" });
                    dtTbBstDirectorLetter.Columns.Add(new DataColumn() { ColumnName = "replytime" });
                    mResultModel.result = "ok";
                    mResultModel.totalCount = dtTbBstDirectorLetter.Rows.Count;
                    ////解密部分加密字段
                    for (int i = 0; i < dtTbBstDirectorLetter.Rows.Count; i++)
                    {
                        dtTbBstDirectorLetter.Rows[i][TbBstDirectorLetterConst.Columns.Phone] = DES.Decode(dtTbBstDirectorLetter.Rows[i][TbBstDirectorLetterConst.Columns.Phone].ToString());
                        dtTbBstDirectorLetter.Rows[i][TbBstDirectorLetterConst.Columns.Name] = DES.Decode(dtTbBstDirectorLetter.Rows[i][TbBstDirectorLetterConst.Columns.Name].ToString());
                        dtTbBstDirectorLetter.Rows[i][TbBstDirectorLetterConst.Columns.Email] = DES.Decode(dtTbBstDirectorLetter.Rows[i][TbBstDirectorLetterConst.Columns.Email].ToString());
                        dtTbBstDirectorLetter.Rows[i][TbBstDirectorLetterConst.Columns.Address] = DES.Decode(dtTbBstDirectorLetter.Rows[i][TbBstDirectorLetterConst.Columns.Address].ToString());
                        #region 每行加回复内容
                        string guid = dtTbBstDirectorLetter.Rows[i][TbBstDirectorLetterConst.Columns.Id].ToString();//取id主键
                        try
                        {
                            var list = TbMsjwSqjgBLL.SelectList(guid);
                            var model = new TbMsjwSqjg();
                            if (list.Count > 0)
                            {
                                if (list.Count == 1)
                                {
                                    model = list.SingleOrDefault();
                                }
                                else if (list.Count > 1)
                                {
                                    var count = list.Where(a => a.Id > 0).Count();
                                    if (count > 0)
                                    {
                                        model = list.FirstOrDefault(a => a.Id > 0);
                                    }
                                    else
                                    {
                                        model = list.OrderByDescending(a => a.ZbBlrq).FirstOrDefault();
                                    }
                                }
                                //replyContent = model.ZbBljg.ToString();
                                //replyName = model.ZbBlrxm.ToString();
                                //replyTime = model.ZbBlrq.ToString();

                                if (string.IsNullOrEmpty(model.ZbBljg))
                                {
                                    replyContent = "";
                                }
                                else
                                {
                                    replyContent = model.ZbBljg.ToString();
                                }
                                if (string.IsNullOrEmpty(model.ZbBlrxm))
                                {
                                    replyName = "";
                                }
                                else
                                {
                                    replyName = model.ZbBlrxm.ToString();
                                }
                                if (model.ZbBlrq.ToString() == "0001/1/1 0:00:00")
                                {
                                    replyTime = "";
                                }
                                else
                                {
                                    replyTime = model.ZbBlrq.ToString();
                                }

                                dtTbBstDirectorLetter.Rows[i]["replycontent"] = replyContent.FilteEnter();
                                dtTbBstDirectorLetter.Rows[i]["replyname"] = replyName;
                                dtTbBstDirectorLetter.Rows[i]["replytime"] = replyTime;
                            }
                            //DataSet ds = Q.GetRecordByPage("*", "where gdid='" + guid + "'", "", 1, 1, "tb_msjw_sqjg", "ID", "");
                            //if (ds.Tables[0].Rows.Count > 0)
                            //{
                            //    replyContent = ds.Tables[0].Rows[0]["ZB_BLJG"].ToString();
                            //    replyName = ds.Tables[0].Rows[0]["ZB_BLRXM"].ToString();
                            //    replyTime = ds.Tables[0].Rows[0]["ZB_BLRQ"].ToString();

                            //    dtTbBstDirectorLetter.Rows[i]["replycontent"] = replyContent;
                            //    dtTbBstDirectorLetter.Rows[i]["replyname"] = replyName;
                            //    dtTbBstDirectorLetter.Rows[i]["replytime"] = replyTime;
                            //}
                        }
                        catch (Exception e)
                        { }
                        #endregion
                    }
                    mResultModel.data = dtTbBstDirectorLetter;
                }
                else
                {
                    mResultModel.result = "error";
                    mResultModel.ErrorCode = -112;
                }
            }
            catch (Exception e)
            {
                mResultModel.result = "error";
            }
            IsoDateTimeConverter dtConverter = new IsoDateTimeConverter { DateTimeFormat = "yyyy-MM-dd HH:mm:ss" };
            HttpContext.Current.Response.Charset = "GB2312";
            HttpContext.Current.Response.ContentEncoding = System.Text.Encoding.GetEncoding("GB2312");
            var result = JsonUtils.ConvertJsonString(JsonConvert.SerializeObject(mResultModel, dtConverter));
            HttpContext.Current.Response.Write(callback + "(" + result + ")");
            var str = JsonConvert.SerializeObject(mResultModel, dtConverter);
            HttpContext.Current.Response.End();
        }
        #endregion

        #region 民意直通 网上信访-添加接口

        /// <summary>
        /// 民意直通 网上信访
        /// </summary>
        [WebMethod]
        public void AddOnlineLetter()
        {
            object filedkey;
            var ip = HttpContext.Current.Request.UserHostAddress;
            string callback = HttpContext.Current.Request["para"];
            string name = DES.Encode(HttpContext.Current.Request["name"].FilteHtml());////姓名
            string phone = DES.Encode(HttpContext.Current.Request["phone"].FilteHtml());////手机号
            string psd = HttpContext.Current.Request["psd"].FilteHtml();////查询密码
            string email = DES.Encode(HttpContext.Current.Request["email"].FilteHtml());////邮箱
            string address = DES.Encode(HttpContext.Current.Request["address"].FilteHtml());////地址
            string content = HttpContext.Current.Request["content"].FilteHtml();////内容
            AjaxResultModel mResultModel = new AjaxResultModel(); //初始化返回类型
            TbBstOnlineLetter mTbBstOnlineLetter = new TbBstOnlineLetter();
            try
            {
                mTbBstOnlineLetter.Id = Guid.NewGuid().ToString(); //主键
                mTbBstOnlineLetter.Lsh = XWG.JWBST.JWBSTBLL.TbBstFastprocessBLL.GetLSH("TB_BST_ONLINE_LETTER");
                mTbBstOnlineLetter.Name = name; ////本人姓名
                mTbBstOnlineLetter.Phone = phone; ////手机号
                mTbBstOnlineLetter.Email = email; ////邮箱
                mTbBstOnlineLetter.Address = address; ////地址
                mTbBstOnlineLetter.Content = content; ////内容
                mTbBstOnlineLetter.Psd = psd; ////密码
                mTbBstOnlineLetter.Ip = ip;
                mTbBstOnlineLetter.Createdate = DateTime.Now;//信息添加时间
                mTbBstOnlineLetter.Deltag = 0; //删除标志0未删除1已删除
                mTbBstOnlineLetter.Movesign = "1";
                mTbBstOnlineLetter.Replysign = "0";
                mTbBstOnlineLetter.Isview = "0";
                mTbBstOnlineLetter.Tabletype = "3";
                filedkey = Db.TransInsert<TbBstOnlineLetter>(mTbBstOnlineLetter);
                mResultModel.result = "ok";
                mResultModel.data = mTbBstOnlineLetter;
            }
            catch (Exception ex)
            {
                MSEx.DealErr(ex, "实体类的插入操作");
                mResultModel.result = "error";
            }
            IsoDateTimeConverter dtConverter = new IsoDateTimeConverter { DateTimeFormat = "yyyy-MM-dd HH:mm:ss" };
            HttpContext.Current.Response.ContentEncoding = System.Text.Encoding.GetEncoding("GB2312");
            var result = JsonUtils.ConvertJsonString(JsonConvert.SerializeObject(mResultModel, dtConverter));
            HttpContext.Current.Response.Write(callback + "(" + result + ")");
            HttpContext.Current.Response.End();
        }
        #endregion

        #region 民意直通 网上信访-个人查询
        /// <summary>
        /// 民意直通 网上信访-个人查询
        /// </summary>
        [WebMethod]
        public void GetOnlineLetterList()
        {
            AjaxResultModel mResultModel = new AjaxResultModel(); //初始化返回类型
            string callback = HttpContext.Current.Request["para"];
            try
            {
                int pageSize = 20;
                int pageIndex = 1;
                var replyContent = "";
                var replyName = "";
                var replyTime = "";
                if (!string.IsNullOrEmpty(HttpContext.Current.Request["pageSize"]))
                {
                    pageSize = Convert.ToInt32(HttpContext.Current.Request["pageSize"]);
                }
                if (pageSize > 30)
                {
                    pageSize = 30;
                }
                if (!string.IsNullOrEmpty(HttpContext.Current.Request["pageIndex"]))
                {
                    pageIndex = Convert.ToInt32(HttpContext.Current.Request["pageIndex"]);
                }
                string phone = DES.Encode(HttpContext.Current.Request["phone"].FilteHtml());
                string psd = HttpContext.Current.Request["psd"].FilteHtml();
                TbBstOnlineLetter mTbBstOnlineAsk = new TbBstOnlineLetter();
                DataTable dtTbBstOnlineLetter = new DataTable();
                QueryByPage Q = new QueryByPage();
                SqlConditionList sqllist = new SqlConditionList();
                string sqlWhere = " deltag = 0 ";
                if (!string.IsNullOrEmpty(phone)) ////手机号
                {
                    sqllist.AddLogic(new SqlConditionList.SqlCondition(SqlCompareOper.EQUAL, TbBstOnlineLetterConst.Columns.Phone, phone), SqlLogicOper.AND_LOGIC);
                }
                if (!string.IsNullOrEmpty(psd)) ////密码
                {
                    sqllist.AddLogic(new SqlConditionList.SqlCondition(SqlCompareOper.EQUAL, TbBstOnlineLetterConst.Columns.Psd, psd), SqlLogicOper.AND_LOGIC);
                }
                if (string.IsNullOrEmpty(sqllist.ToSql()))
                {
                    sqlWhere = "where" + sqlWhere;
                }
                else
                {
                    sqlWhere = sqllist.ToSql() + " and " + sqlWhere;
                }
                dtTbBstOnlineLetter = Q.GetRecordByPage("*", sqlWhere, " createdate ", pageSize, pageIndex, TbBstOnlineLetterConst.TableName, TbBstOnlineLetterConst.FieldKey, "desc").Tables[0];
                XWG.JWBST.JWBSTBLL.TbBstOnlineLetterBLL.updateView(phone, psd);
                if (dtTbBstOnlineLetter != null && dtTbBstOnlineLetter.Rows.Count > -1)
                {
                    dtTbBstOnlineLetter.Columns.Add(new DataColumn() { ColumnName = "replycontent" });
                    dtTbBstOnlineLetter.Columns.Add(new DataColumn() { ColumnName = "replyname" });
                    dtTbBstOnlineLetter.Columns.Add(new DataColumn() { ColumnName = "replytime" });
                    mResultModel.result = "ok";
                    mResultModel.totalCount = dtTbBstOnlineLetter.Rows.Count;
                    ////解密部分加密字段
                    for (int i = 0; i < dtTbBstOnlineLetter.Rows.Count; i++)
                    {
                        dtTbBstOnlineLetter.Rows[i][TbBstOnlineLetterConst.Columns.Phone] = DES.Decode(dtTbBstOnlineLetter.Rows[i][TbBstOnlineLetterConst.Columns.Phone].ToString());
                        dtTbBstOnlineLetter.Rows[i][TbBstOnlineLetterConst.Columns.Name] = DES.Decode(dtTbBstOnlineLetter.Rows[i][TbBstOnlineLetterConst.Columns.Name].ToString());
                        dtTbBstOnlineLetter.Rows[i][TbBstOnlineLetterConst.Columns.Email] = DES.Decode(dtTbBstOnlineLetter.Rows[i][TbBstOnlineLetterConst.Columns.Email].ToString());
                        dtTbBstOnlineLetter.Rows[i][TbBstOnlineLetterConst.Columns.Address] = DES.Decode(dtTbBstOnlineLetter.Rows[i][TbBstOnlineLetterConst.Columns.Address].ToString());
                        #region 每行加回复内容
                        string guid = dtTbBstOnlineLetter.Rows[i][TbBstDirectorLetterConst.Columns.Id].ToString();//取id主键
                        try
                        {
                            var list = TbMsjwSqjgBLL.SelectList(guid);
                            var model = new TbMsjwSqjg();
                            if (list.Count > 0)
                            {
                                if (list.Count == 1)
                                {
                                    model = list.SingleOrDefault();
                                }
                                else if (list.Count > 1)
                                {
                                    var count = list.Where(a => a.Id > 0).Count();
                                    if (count > 0)
                                    {
                                        model = list.FirstOrDefault(a => a.Id > 0);
                                    }
                                    else
                                    {
                                        model = list.OrderByDescending(a => a.ZbBlrq).FirstOrDefault();
                                    }
                                }
                                //replyContent = model.ZbBljg.ToString();
                                //replyName = model.ZbBlrxm.ToString();
                                //replyTime = model.ZbBlrq.ToString();

                                if (string.IsNullOrEmpty(model.ZbBljg))
                                {
                                    replyContent = "";
                                }
                                else
                                {
                                    replyContent = model.ZbBljg.ToString();
                                }
                                if (string.IsNullOrEmpty(model.ZbBlrxm))
                                {
                                    replyName = "";
                                }
                                else
                                {
                                    replyName = model.ZbBlrxm.ToString();
                                }
                                if (model.ZbBlrq.ToString() == "0001/1/1 0:00:00")
                                {
                                    replyTime = "";
                                }
                                else
                                {
                                    replyTime = model.ZbBlrq.ToString();
                                }

                                dtTbBstOnlineLetter.Rows[i]["replycontent"] = replyContent.FilteEnter();
                                dtTbBstOnlineLetter.Rows[i]["replyname"] = replyName;
                                dtTbBstOnlineLetter.Rows[i]["replytime"] = replyTime;
                            }
                            //DataSet ds = Q.GetRecordByPage("*", "where gdid='" + guid + "'", "", 1, 1, "tb_msjw_sqjg", "ID", "");
                            //if (ds.Tables[0].Rows.Count > 0)
                            //{
                            //    replyContent = ds.Tables[0].Rows[0]["ZB_BLJG"].ToString();
                            //    replyName = ds.Tables[0].Rows[0]["ZB_BLRXM"].ToString();
                            //    replyTime = ds.Tables[0].Rows[0]["ZB_BLRQ"].ToString();
                            //    dtTbBstOnlineLetter.Rows[i]["replyname"] = replyName;
                            //    dtTbBstOnlineLetter.Rows[i]["replytime"] = replyTime;
                            //    dtTbBstOnlineLetter.Rows[i]["replycontent"] = replyContent;
                            //}
                        }
                        catch (Exception e)
                        { }
                        #endregion
                    }
                    mResultModel.data = dtTbBstOnlineLetter;
                }
                else
                {
                    mResultModel.result = "error";
                    mResultModel.ErrorCode = -112;
                }
            }
            catch (Exception e)
            {
                mResultModel.result = "error";
            }
            IsoDateTimeConverter dtConverter = new IsoDateTimeConverter { DateTimeFormat = "yyyy-MM-dd HH:mm:ss" };
            HttpContext.Current.Response.Charset = "GB2312";
            HttpContext.Current.Response.ContentEncoding = System.Text.Encoding.GetEncoding("GB2312");
            var result = JsonUtils.ConvertJsonString(JsonConvert.SerializeObject(mResultModel, dtConverter));
            HttpContext.Current.Response.Write(callback + "(" + result + ")");
            var str = JsonConvert.SerializeObject(mResultModel, dtConverter);
            HttpContext.Current.Response.End();
        }
        #endregion

        #region 诉求直通 诉求信息-添加接口

        /// <summary>
        /// 诉求直通 诉求信息
        /// </summary>
        [WebMethod]
        public void AddDemandsInfo()
        {
            object filedkey;
            var ip = HttpContext.Current.Request.UserHostAddress;
            string callback = HttpContext.Current.Request["para"];
            string name = DES.Encode(HttpContext.Current.Request["name"].FilteHtml());////姓名
            string phone = DES.Encode(HttpContext.Current.Request["phone"].FilteHtml());////手机号
            string psd = HttpContext.Current.Request["psd"].FilteHtml();////查询密码
            string email = DES.Encode(HttpContext.Current.Request["email"].FilteHtml());////邮箱
            string address = DES.Encode(HttpContext.Current.Request["address"].FilteHtml());////地址
            string source = HttpContext.Current.Request["source"].FilteHtml();////来源
            string sourcename = HttpContext.Current.Request["sourcename"].FilteHtml();////名称
            string content = HttpContext.Current.Request["content"].FilteHtml();////内容
            string policekind = HttpContext.Current.Request["policekind"];////警种
            string orgcode = HttpContext.Current.Request["orgcode"];////组织机构
            string firmphone = DES.Encode(HttpContext.Current.Request["firmphone"].FilteHtml());
            AjaxResultModel mResultModel = new AjaxResultModel(); //初始化返回类型
            TbBstAppeal mTbBstAppeal = new TbBstAppeal();
            try
            {
                mTbBstAppeal.Lsh = XWG.JWBST.JWBSTBLL.TbBstFastprocessBLL.GetLSH("TB_BST_APPEAL");
                mTbBstAppeal.Id = Guid.NewGuid().ToString(); //主键
                mTbBstAppeal.Name = name; ////本人姓名
                mTbBstAppeal.Phone = phone; ////手机号
                mTbBstAppeal.Email = email; ////邮箱
                mTbBstAppeal.Content = content; ////内容
                mTbBstAppeal.Address = address; ////地址
                mTbBstAppeal.Police = policekind; ////警种
                mTbBstAppeal.Psd = psd;
                mTbBstAppeal.Ip = ip;
                mTbBstAppeal.Source = source;
                mTbBstAppeal.Sourcename = sourcename;
                mTbBstAppeal.Orgna = orgcode; ////组织机构
                mTbBstAppeal.Createdate = DateTime.Now;//信息添加时间
                mTbBstAppeal.Deltag = 0; //删除标志0未删除1已删除
                mTbBstAppeal.Firmphone = firmphone; //企业电话
                mTbBstAppeal.Movesign = "1";
                mTbBstAppeal.Replysign = "0";
                mTbBstAppeal.Isview = "0";
                mTbBstAppeal.Tabletype = "1";
                filedkey = Db.TransInsert<TbBstAppeal>(mTbBstAppeal);
                mResultModel.result = "ok";

                mResultModel.data = mTbBstAppeal;
            }
            catch (Exception ex)
            {
                MSEx.DealErr(ex, "实体类的插入操作");
                mResultModel.result = "error";
            }
            IsoDateTimeConverter dtConverter = new IsoDateTimeConverter { DateTimeFormat = "yyyy-MM-dd HH:mm:ss" };
            HttpContext.Current.Response.ContentEncoding = System.Text.Encoding.GetEncoding("GB2312");
            var result = JsonUtils.ConvertJsonString(JsonConvert.SerializeObject(mResultModel, dtConverter));
            HttpContext.Current.Response.Write(callback + "(" + result + ")");
            HttpContext.Current.Response.End();
        }
        #endregion

        #region 诉求直通 诉求信息-个人查询
        /// <summary>
        /// 诉求直通 诉求信息-个人查询
        /// </summary>
        [WebMethod]
        public void GetDemandsInfoList()
        {
            AjaxResultModel mResultModel = new AjaxResultModel(); //初始化返回类型
            string callback = HttpContext.Current.Request["para"];
            try
            {
                int pageSize = 20;
                int pageIndex = 1;
                var replyContent = "";
                var replyName = "";
                var replyTime = "";
                if (!string.IsNullOrEmpty(HttpContext.Current.Request["pageSize"]))
                {
                    pageSize = Convert.ToInt32(HttpContext.Current.Request["pageSize"]);
                }
                if (pageSize > 30)
                {
                    pageSize = 30;
                }
                if (!string.IsNullOrEmpty(HttpContext.Current.Request["pageIndex"]))
                {
                    pageIndex = Convert.ToInt32(HttpContext.Current.Request["pageIndex"]);
                }
                string phone = DES.Encode(HttpContext.Current.Request["phone"].FilteHtml());
                string psd = HttpContext.Current.Request["psd"].FilteHtml();
                TbBstAppeal mTbBstOnlineAsk = new TbBstAppeal();
                DataTable dtTbBstAppeal = new DataTable();
                QueryByPage Q = new QueryByPage();
                SqlConditionList sqllist = new SqlConditionList();
                string sqlWhere = " deltag = 0 ";
                if (!string.IsNullOrEmpty(phone)) ////手机号
                {
                    sqllist.AddLogic(new SqlConditionList.SqlCondition(SqlCompareOper.EQUAL, TbBstAppealConst.Columns.Phone, phone), SqlLogicOper.AND_LOGIC);
                }
                if (!string.IsNullOrEmpty(psd)) ////密码
                {
                    sqllist.AddLogic(new SqlConditionList.SqlCondition(SqlCompareOper.EQUAL, TbBstAppealConst.Columns.Psd, psd), SqlLogicOper.AND_LOGIC);
                }
                if (string.IsNullOrEmpty(sqllist.ToSql()))
                {
                    sqlWhere = "where" + sqlWhere;
                }
                else
                {
                    sqlWhere = sqllist.ToSql() + " and " + sqlWhere;
                }
                dtTbBstAppeal = Q.GetRecordByPage("*", sqlWhere, " createdate ", pageSize, pageIndex, TbBstAppealConst.TableName, TbBstAppealConst.FieldKey, "desc").Tables[0];
                XWG.JWBST.JWBSTBLL.TbBstAppealBLL.updateView(phone, psd);
                if (dtTbBstAppeal != null && dtTbBstAppeal.Rows.Count > -1)
                {
                    dtTbBstAppeal.Columns.Add(new DataColumn() { ColumnName = "replycontent" });
                    dtTbBstAppeal.Columns.Add(new DataColumn() { ColumnName = "replyname" });
                    dtTbBstAppeal.Columns.Add(new DataColumn() { ColumnName = "replytime" });
                    mResultModel.result = "ok";
                    mResultModel.totalCount = dtTbBstAppeal.Rows.Count;
                    ////解密部分加密字段
                    for (int i = 0; i < dtTbBstAppeal.Rows.Count; i++)
                    {
                        dtTbBstAppeal.Rows[i][TbBstAppealConst.Columns.Phone] = DES.Decode(dtTbBstAppeal.Rows[i][TbBstAppealConst.Columns.Phone].ToString());
                        dtTbBstAppeal.Rows[i][TbBstAppealConst.Columns.Name] = DES.Decode(dtTbBstAppeal.Rows[i][TbBstAppealConst.Columns.Name].ToString());
                        dtTbBstAppeal.Rows[i][TbBstAppealConst.Columns.Email] = DES.Decode(dtTbBstAppeal.Rows[i][TbBstAppealConst.Columns.Email].ToString());
                        dtTbBstAppeal.Rows[i][TbBstAppealConst.Columns.Address] = DES.Decode(dtTbBstAppeal.Rows[i][TbBstAppealConst.Columns.Address].ToString());
                        dtTbBstAppeal.Rows[i][TbBstAppealConst.Columns.Firmphone] = DES.Decode(dtTbBstAppeal.Rows[i][TbBstAppealConst.Columns.Firmphone].ToString());
                        #region 每行加回复内容
                        string guid = dtTbBstAppeal.Rows[i][TbBstDirectorLetterConst.Columns.Id].ToString();//取id主键
                        try
                        {
                            var list = TbMsjwSqjgBLL.SelectList(guid);
                            var model = new TbMsjwSqjg();
                            if (list.Count > 0)
                            {
                                if (list.Count == 1)
                                {
                                    model = list.SingleOrDefault();
                                }
                                else if (list.Count > 1)
                                {
                                    var count = list.Where(a => a.Id > 0).Count();
                                    if (count > 0)
                                    {
                                        model = list.FirstOrDefault(a => a.Id > 0);
                                    }
                                    else
                                    {
                                        model = list.OrderByDescending(a => a.ZbBlrq).FirstOrDefault();
                                    }
                                }
                                //replyContent = model.ZbBljg.ToString();
                                //replyName = model.ZbBlrxm.ToString();
                                //replyTime = model.ZbBlrq.ToString();

                                if (string.IsNullOrEmpty(model.ZbBljg))
                                {
                                    replyContent = "";
                                }
                                else
                                {
                                    replyContent = model.ZbBljg.ToString();
                                }
                                if (string.IsNullOrEmpty(model.ZbBlrxm))
                                {
                                    replyName = "";
                                }
                                else
                                {
                                    replyName = model.ZbBlrxm.ToString();
                                }
                                if (model.ZbBlrq.ToString() == "0001/1/1 0:00:00")
                                {
                                    replyTime = "";
                                }
                                else
                                {
                                    replyTime = model.ZbBlrq.ToString();
                                }

                                dtTbBstAppeal.Rows[i]["replycontent"] = replyContent.FilteEnter();
                                dtTbBstAppeal.Rows[i]["replyname"] = replyName;
                                dtTbBstAppeal.Rows[i]["replytime"] = replyTime;
                            }
                            //DataSet ds = Q.GetRecordByPage("*", "where gdid='" + guid + "'", "", 1, 1, "tb_msjw_sqjg", "ID", "");
                            //if (ds.Tables[0].Rows.Count > 0)
                            //{
                            //    replyContent = ds.Tables[0].Rows[0]["ZB_BLJG"].ToString();
                            //    replyName = ds.Tables[0].Rows[0]["ZB_BLRXM"].ToString();
                            //    replyTime = ds.Tables[0].Rows[0]["ZB_BLRQ"].ToString();
                            //    dtTbBstAppeal.Rows[i]["replycontent"] = replyContent;
                            //    dtTbBstAppeal.Rows[i]["replyname"] = replyName;
                            //    dtTbBstAppeal.Rows[i]["replytime"] = replyTime;
                            //}
                        }
                        catch (Exception e)
                        {

                        }
                        #endregion
                    }
                    mResultModel.data = dtTbBstAppeal;
                }
                else
                {
                    mResultModel.result = "error";
                    mResultModel.ErrorCode = -112;
                }
            }
            catch (Exception e)
            {
                mResultModel.result = "error";
            }
            IsoDateTimeConverter dtConverter = new IsoDateTimeConverter { DateTimeFormat = "yyyy-MM-dd HH:mm:ss" };
            HttpContext.Current.Response.Charset = "GB2312";
            HttpContext.Current.Response.ContentEncoding = System.Text.Encoding.GetEncoding("GB2312");
            var result = JsonUtils.ConvertJsonString(JsonConvert.SerializeObject(mResultModel, dtConverter));
            HttpContext.Current.Response.Write(callback + "(" + result + ")");
            var str = JsonConvert.SerializeObject(mResultModel, dtConverter);
            HttpContext.Current.Response.End();
        }
        #endregion

        #region 为您办事添加接口

        #region -----禁毒接口-----全无关联
        #region 易制毒化学品购买申请
        /// <summary>
        /// 易制毒化学品购买申请
        /// </summary>
        [WebMethod]
        public void AddMsjJdYzdhxpgmsq()
        {
            object filedkey;
            string callback = HttpContext.Current.Request["para"];
            string xm = HttpContext.Current.Request["xm"].FilteHtml();//姓名
            string zz = HttpContext.Current.Request["zz"].FilteHtml();//住址
            string fddbr = HttpContext.Current.Request["fddbr"].FilteHtml();//法定代表人
            string frdh = HttpContext.Current.Request["frdh"].FilteHtml();//法人电话
            string jbr = HttpContext.Current.Request["jbr"].FilteHtml();//经办人
            string jbrdh = HttpContext.Current.Request["jbrdh"].FilteHtml();//经办人电话
            string xsdwmc = HttpContext.Current.Request["xsdwmc"].FilteHtml();//销售单位名称
            string xsdwzs = HttpContext.Current.Request["xsdwzs"].FilteHtml();//销售单位住所
            string xsfddbr = HttpContext.Current.Request["xsfddbr"].FilteHtml();//销售法定代表人
            string xsfddbrdh = HttpContext.Current.Request["xsfddbrdh"].FilteHtml();//销售法定代表人电话
            string pz = HttpContext.Current.Request["pz"].FilteHtml();//品种
            string sl = HttpContext.Current.Request["sl"].FilteHtml();//数量
            string yt = HttpContext.Current.Request["yt"].FilteHtml();//用途
            string nxql = HttpContext.Current.Request["nxql"].FilteHtml();//年需求量
            string scyj = HttpContext.Current.Request["scyj"].FilteHtml();//审查意见
            string scrqm = HttpContext.Current.Request["scrqm"].FilteHtml();//审查人签名
            string scrq = HttpContext.Current.Request["scrq"].FilteHtml();//审查日期
            string spyj = HttpContext.Current.Request["spyj"].FilteHtml();//审批意见
            string sprqm = HttpContext.Current.Request["sprqm"].FilteHtml();//审批人签名
            string sprq = HttpContext.Current.Request["sprq"].FilteHtml();//审批日期
            string sqrqm = HttpContext.Current.Request["sqrqm"].FilteHtml();//申请人签名
            string sqrq = HttpContext.Current.Request["sqrq"].FilteHtml();//申请日期
            string sljg = HttpContext.Current.Request["sljg"].FilteHtml();//受理机关(字典)
            string bz = HttpContext.Current.Request["bz"].FilteHtml();//备注
            AjaxResultModel mResultModel = new AjaxResultModel(); //初始化返回类型
            MsjJdYzdhxpgmsq msjjdyzdhxpgmsq = new MsjJdYzdhxpgmsq();
            try
            {
                msjjdyzdhxpgmsq.Sqid = Guid.NewGuid().ToString(); //主键
                msjjdyzdhxpgmsq.Xm = xm;//姓名
                msjjdyzdhxpgmsq.Zz = zz;//住址
                msjjdyzdhxpgmsq.Fddbr = fddbr;//法定代表人
                msjjdyzdhxpgmsq.Frdh = frdh;//法人电话
                msjjdyzdhxpgmsq.Jbr = jbr;//经办人
                msjjdyzdhxpgmsq.Jbrdh = jbrdh;//经办人电话
                msjjdyzdhxpgmsq.Xsdwmc = xsdwmc;//销售单位名称
                msjjdyzdhxpgmsq.Xsdwzs = xsdwzs;//销售单位住所
                msjjdyzdhxpgmsq.Xsfddbr = xsfddbr;//销售法定代表人
                msjjdyzdhxpgmsq.Xsfddbrdh = xsfddbrdh;//销售法定代表人电话
                msjjdyzdhxpgmsq.Pz = pz;//品种
                msjjdyzdhxpgmsq.Sl = sl;//数量
                msjjdyzdhxpgmsq.Yt = yt;//用途
                msjjdyzdhxpgmsq.Nxql = nxql;//年需求量
                msjjdyzdhxpgmsq.Scyj = scyj;//审查意见
                msjjdyzdhxpgmsq.Scrqm = scrqm;//审查人签名
                msjjdyzdhxpgmsq.Scrq = scrq;//审查日期
                msjjdyzdhxpgmsq.Spyj = spyj;//审批意见
                msjjdyzdhxpgmsq.Sprqm = sprqm;//审批人签名
                msjjdyzdhxpgmsq.Sprq = sprq;//审批日期
                msjjdyzdhxpgmsq.Sqrqm = sqrqm;//申请人签名
                msjjdyzdhxpgmsq.Sqrq = sqrq;//申请日期
                msjjdyzdhxpgmsq.Sljg = sljg;//受理机关(字典)
                msjjdyzdhxpgmsq.Bz = bz;//备注
                msjjdyzdhxpgmsq.Cjsj = DateTime.Now.ToString();////信息添加时间
                msjjdyzdhxpgmsq.Movesign = "0";////是否传输
                msjjdyzdhxpgmsq.Enabled = "1";////是否有效

                filedkey = Db.TransInsert<MsjJdYzdhxpgmsq>(msjjdyzdhxpgmsq);
                mResultModel.result = "ok";
            }
            catch (Exception ex)
            {
                MSEx.DealErr(ex, "实体类的插入操作" + ex.Message.ToString());
                mResultModel.result = "error";
            }
            IsoDateTimeConverter dtConverter = new IsoDateTimeConverter { DateTimeFormat = "yyyy-MM-dd HH:mm:ss" };
            HttpContext.Current.Response.ContentEncoding = System.Text.Encoding.GetEncoding("GB2312");
            var result = JsonUtils.ConvertJsonString(JsonConvert.SerializeObject(mResultModel, dtConverter));
            HttpContext.Current.Response.Write(callback + "(" + result + ")");
            HttpContext.Current.Response.End();
        }
        #endregion

        #region 易制毒化学品运输申请
        /// <summary>
        /// 易制毒化学品运输申请
        /// </summary>
        [WebMethod]
        public void AddMsjJdYzdhxpyssq()
        {
            object filedkey;
            string callback = HttpContext.Current.Request["para"];
            string mcxm = HttpContext.Current.Request["mcxm"].FilteHtml();//名称姓名
            string zz = HttpContext.Current.Request["zz"].FilteHtml();//住址
            string fddbr = HttpContext.Current.Request["fddbr"].FilteHtml();//法定代表人
            string frdh = HttpContext.Current.Request["frdh"].FilteHtml();//法人电话
            string jbr = HttpContext.Current.Request["jbr"].FilteHtml();//经办人
            string jbrdh = HttpContext.Current.Request["jbrdh"].FilteHtml();//经办人电话
            string ysdwmc = HttpContext.Current.Request["ysdwmc"].FilteHtml();//运输单位名称
            string ysdwzs = HttpContext.Current.Request["ysdwzs"].FilteHtml();//运输单位住所
            string pz = HttpContext.Current.Request["pz"].FilteHtml();//品种
            string sl = HttpContext.Current.Request["sl"].FilteHtml();//数量
            string ysfs = HttpContext.Current.Request["ysfs"].FilteHtml();//运输方式
            string hc = HttpContext.Current.Request["hc"].FilteHtml();//号次
            string yslx = HttpContext.Current.Request["yslx"].FilteHtml();//运输路线
            string gmxkzbazm = HttpContext.Current.Request["gmxkzbazm"].FilteHtml();//购买许可证备案证明
            string ckxkzh = HttpContext.Current.Request["ckxkzh"].FilteHtml();//出口许可证号
            string scyj = HttpContext.Current.Request["scyj"].FilteHtml();//审查意见
            string scrqm = HttpContext.Current.Request["scrqm"].FilteHtml();//审查人签名
            string scrq = HttpContext.Current.Request["scrq"].FilteHtml();//审查日期
            string spyj = HttpContext.Current.Request["spyj"].FilteHtml();//审批意见
            string sprqm = HttpContext.Current.Request["sprqm"].FilteHtml();//审批人签名
            string sprq = HttpContext.Current.Request["sprq"].FilteHtml();//审批日期
            string sqrqm = HttpContext.Current.Request["sqrqm"].FilteHtml();//申请人签名
            string sqrq = HttpContext.Current.Request["sqrq"].FilteHtml();//申请日期
            string sljg = HttpContext.Current.Request["sljg"].FilteHtml();//受理机关(字典)
            string bz = HttpContext.Current.Request["bz"].FilteHtml();//备注
            AjaxResultModel mResultModel = new AjaxResultModel(); //初始化返回类型
            MsjJdYzdhxpyssq msjjdyzdhxpyssq = new MsjJdYzdhxpyssq();
            try
            {
                msjjdyzdhxpyssq.Sqid = Guid.NewGuid().ToString(); //主键
                msjjdyzdhxpyssq.Mcxm = mcxm;//名称姓名
                msjjdyzdhxpyssq.Zz = zz;//住址
                msjjdyzdhxpyssq.Fddbr = fddbr;//法定代表人
                msjjdyzdhxpyssq.Frdh = frdh;//法人电话
                msjjdyzdhxpyssq.Jbr = jbr;//经办人
                msjjdyzdhxpyssq.Jbrdh = jbrdh;//经办人电话
                msjjdyzdhxpyssq.Ysdwmc = ysdwmc;//运输单位名称
                msjjdyzdhxpyssq.Ysdwzs = ysdwzs;//运输单位住所
                msjjdyzdhxpyssq.Pz = pz;//品种
                msjjdyzdhxpyssq.Sl = sl;//数量
                msjjdyzdhxpyssq.Ysfs = ysfs;//运输方式
                msjjdyzdhxpyssq.Hc = hc;//号次
                msjjdyzdhxpyssq.Yslx = yslx;//运输路线
                msjjdyzdhxpyssq.Gmxkzbazm = gmxkzbazm;//购买许可证备案证明
                msjjdyzdhxpyssq.Ckxkzh = ckxkzh;//出口许可证号
                msjjdyzdhxpyssq.Scyj = scyj;//审查意见
                msjjdyzdhxpyssq.Scrqm = scrqm;//审查人签名
                msjjdyzdhxpyssq.Scrq = scrq;//审查日期
                msjjdyzdhxpyssq.Spyj = spyj;//审批意见
                msjjdyzdhxpyssq.Sprqm = sprqm;//审批人签名
                msjjdyzdhxpyssq.Sprq = sprq;//审批日期
                msjjdyzdhxpyssq.Sqrqm = sqrqm;//申请人签名
                msjjdyzdhxpyssq.Sqrq = sqrq;//申请日期
                msjjdyzdhxpyssq.Sljg = sljg;//受理机关(字典)
                msjjdyzdhxpyssq.Bz = bz;//备注
                msjjdyzdhxpyssq.Cjsj = DateTime.Now.ToString();////信息添加时间
                msjjdyzdhxpyssq.Movesign = "0";////是否传输
                msjjdyzdhxpyssq.Enabled = "1";////是否有效

                filedkey = Db.TransInsert<MsjJdYzdhxpyssq>(msjjdyzdhxpyssq);
                mResultModel.result = "ok";
            }
            catch (Exception ex)
            {
                MSEx.DealErr(ex, "实体类的插入操作" + ex.Message.ToString());
                mResultModel.result = "error";
            }
            IsoDateTimeConverter dtConverter = new IsoDateTimeConverter { DateTimeFormat = "yyyy-MM-dd HH:mm:ss" };
            HttpContext.Current.Response.ContentEncoding = System.Text.Encoding.GetEncoding("GB2312");
            var result = JsonUtils.ConvertJsonString(JsonConvert.SerializeObject(mResultModel, dtConverter));
            HttpContext.Current.Response.Write(callback + "(" + result + ")");
            HttpContext.Current.Response.End();
        }
        #endregion

        #endregion

        #region -----刑警接口------全无关联
        #region 出具有无犯罪记录证明申请
        /// <summary>
        ///  出具有无犯罪记录证明申请
        /// </summary>
        [WebMethod]
        public void AddMsjXjCjywfzjlzmsq()
        {
            object filedkey;
            string callback = HttpContext.Current.Request["para"];
            string xm = HttpContext.Current.Request["xm"].FilteHtml();//姓名
            string xb = HttpContext.Current.Request["xb"].FilteHtml();//性别(字典)
            string csrq = HttpContext.Current.Request["csrq"].FilteHtml();//出生日期
            string cym = HttpContext.Current.Request["cym"].FilteHtml();//曾用名
            string xzz = HttpContext.Current.Request["xzz"].FilteHtml();//现住址
            string hjd = HttpContext.Current.Request["hjd"].FilteHtml();//户籍地
            string gzdw = HttpContext.Current.Request["gzdw"].FilteHtml();//工作单位
            string sspcs = HttpContext.Current.Request["sspcs"].FilteHtml();//所属派出所(字典)
            string sfzh = HttpContext.Current.Request["sfzh"].FilteHtml();//身份证号
            string fsdwlxdh = HttpContext.Current.Request["fsdwlxdh"].FilteHtml();//发送单位联系电话
            string grjl = HttpContext.Current.Request["grjl"].FilteHtml();//个人简历
            string blyy = HttpContext.Current.Request["blyy"].FilteHtml();//办理原因
            string slr = HttpContext.Current.Request["slr"].FilteHtml();//受理人
            string slsj = HttpContext.Current.Request["slsj"].FilteHtml();//受理时间
            string wtrqz = HttpContext.Current.Request["wtrqz"].FilteHtml();//委托人签字
            string jdjg = HttpContext.Current.Request["jdjg"].FilteHtml();//鉴定结果
            string ldps = HttpContext.Current.Request["ldps"].FilteHtml();//领导批示
            //string zsszzw = HttpContext.Current.Request["zsszzw"].FilteHtml();//左手食指指纹
            //string ysszzw = HttpContext.Current.Request["ysszzw"].FilteHtml();//右手食指指纹
            string fsdw = HttpContext.Current.Request["fsdw"].FilteHtml();//发送单位
            AjaxResultModel mResultModel = new AjaxResultModel(); //初始化返回类型
            MsjXjCjywfzjlzmsq msjxjcjywfzjlzmsq = new MsjXjCjywfzjlzmsq();
            try
            {
                msjxjcjywfzjlzmsq.Sqid = Guid.NewGuid().ToString(); //主键
                msjxjcjywfzjlzmsq.Xm = xm;//姓名
                msjxjcjywfzjlzmsq.Xb = xb;//性别(字典)
                msjxjcjywfzjlzmsq.Csrq = csrq;//出生日期
                msjxjcjywfzjlzmsq.Cym = cym;//曾用名
                msjxjcjywfzjlzmsq.Xzz = xzz;//现住址
                msjxjcjywfzjlzmsq.Hjd = hjd;//户籍地
                msjxjcjywfzjlzmsq.Gzdw = gzdw;//工作单位
                msjxjcjywfzjlzmsq.Sspcs = sspcs;//所属派出所(字典)
                msjxjcjywfzjlzmsq.Sfzh = sfzh;//身份证号
                msjxjcjywfzjlzmsq.Fsdwlxdh = fsdwlxdh;//发送单位联系电话
                msjxjcjywfzjlzmsq.Grjl = grjl;//个人简历
                msjxjcjywfzjlzmsq.Blyy = blyy;//办理原因
                msjxjcjywfzjlzmsq.Slr = slr;//受理人
                msjxjcjywfzjlzmsq.Slsj = slsj;//受理时间
                msjxjcjywfzjlzmsq.Wtrqz = wtrqz;//委托人签字
                msjxjcjywfzjlzmsq.Jdjg = jdjg;//鉴定结果
                msjxjcjywfzjlzmsq.Ldps = ldps;//领导批示
                //msjxjcjywfzjlzmsq.Zsszzw = zsszzw;//左手食指指纹
                //msjxjcjywfzjlzmsq.Ysszzw = ysszzw;//右手食指指纹
                msjxjcjywfzjlzmsq.Fsdw = fsdw;//发送单位
                msjxjcjywfzjlzmsq.Cjsj = DateTime.Now.ToString();////信息添加时间
                msjxjcjywfzjlzmsq.Movesign = "0";////是否传输
                msjxjcjywfzjlzmsq.Enabled = "1";////是否有效

                filedkey = Db.TransInsert<MsjXjCjywfzjlzmsq>(msjxjcjywfzjlzmsq);
                mResultModel.result = "ok";
            }
            catch (Exception ex)
            {
                MSEx.DealErr(ex, "实体类的插入操作" + ex.Message.ToString());
                mResultModel.result = "error";
            }
            IsoDateTimeConverter dtConverter = new IsoDateTimeConverter { DateTimeFormat = "yyyy-MM-dd HH:mm:ss" };
            HttpContext.Current.Response.ContentEncoding = System.Text.Encoding.GetEncoding("GB2312");
            var result = JsonUtils.ConvertJsonString(JsonConvert.SerializeObject(mResultModel, dtConverter));
            HttpContext.Current.Response.Write(callback + "(" + result + ")");
            HttpContext.Current.Response.End();
        }
        #endregion

        #region 机动车被盗抢证明
        /// <summary>
        ///  机动车被盗抢证明
        /// </summary>
        [WebMethod]
        public void AddMsjXjJdcbdqzm()
        {
            object filedkey;
            string callback = HttpContext.Current.Request["para"];
            string xm = HttpContext.Current.Request["xm"].FilteHtml();//姓名
            string sfzh = HttpContext.Current.Request["sfzh"].FilteHtml();//身份证号
            string lxdh = HttpContext.Current.Request["lxdh"].FilteHtml();//联系电话
            string zz = HttpContext.Current.Request["zz"].FilteHtml();//住址
            string cphm = HttpContext.Current.Request["cphm"].FilteHtml();//车牌号码
            string clppxh = HttpContext.Current.Request["clppxh"].FilteHtml();//车辆品牌型号
            string clsbhm = HttpContext.Current.Request["clsbhm"].FilteHtml();//车辆识别号码
            string fdjhm = HttpContext.Current.Request["fdjhm"].FilteHtml();//发动机号码
            string cljyqk = HttpContext.Current.Request["cljyqk"].FilteHtml();//车辆简要情况
            string bdh = HttpContext.Current.Request["bdh"].FilteHtml();//保单号
            string bxgsmc = HttpContext.Current.Request["bxgsmc"].FilteHtml();//保险公司名称
            string basj = HttpContext.Current.Request["basj"].FilteHtml();//报案时间
            string baqk = HttpContext.Current.Request["baqk"].FilteHtml();//报案情况
            string bafs = HttpContext.Current.Request["bafs"].FilteHtml();//报案方式
            string ajsldw = HttpContext.Current.Request["ajsldw"].FilteHtml();//案件受理单位
            string qxsgaj = HttpContext.Current.Request["qxsgaj"].FilteHtml();//区县市公安局(字典)
            string qxsgaj2 = HttpContext.Current.Request["qxsgaj2"].FilteHtml();//派出所或刑警中队(字典)
            string slr = HttpContext.Current.Request["slr"].FilteHtml();//受理人
            string sqrqz = HttpContext.Current.Request["sqrqz"].FilteHtml();//申请人签字
            string qzrq = HttpContext.Current.Request["qzrq"].FilteHtml();//签字日期
            string sljg = HttpContext.Current.Request["sljg"].FilteHtml();//受理机关(字典)
            AjaxResultModel mResultModel = new AjaxResultModel(); //初始化返回类型
            MsjXjJdcbdqzm msjxjjdcbdqzm = new MsjXjJdcbdqzm();
            try
            {
                msjxjjdcbdqzm.Sqid = Guid.NewGuid().ToString(); //主键
                msjxjjdcbdqzm.Xm = xm;//姓名
                msjxjjdcbdqzm.Sfzh = sfzh;//身份证号
                msjxjjdcbdqzm.Lxdh = lxdh;//联系电话
                msjxjjdcbdqzm.Zz = zz;//住址
                msjxjjdcbdqzm.Cphm = cphm;//车牌号码
                msjxjjdcbdqzm.Clppxh = clppxh;//车辆品牌型号
                msjxjjdcbdqzm.Clsbhm = clsbhm;//车辆识别号码
                msjxjjdcbdqzm.Fdjhm = fdjhm;//发动机号码
                msjxjjdcbdqzm.Cljyqk = cljyqk;//车辆简要情况
                msjxjjdcbdqzm.Bdh = bdh;//保单号
                msjxjjdcbdqzm.Bxgsmc = bxgsmc;//保险公司名称
                msjxjjdcbdqzm.Basj = basj;//报案时间
                msjxjjdcbdqzm.Baqk = baqk;//报案情况
                msjxjjdcbdqzm.Bafs = bafs;//报案方式
                msjxjjdcbdqzm.Ajsldw = ajsldw;//案件受理单位
                msjxjjdcbdqzm.Qxsgaj = qxsgaj;//区县市公安局(字典)
                msjxjjdcbdqzm.Qxsgaj2 = qxsgaj2;//派出所或刑警中队(字典)
                msjxjjdcbdqzm.Slr = slr;//受理人
                msjxjjdcbdqzm.Sqrqz = sqrqz;//申请人签字
                msjxjjdcbdqzm.Qzrq = qzrq;//签字日期
                msjxjjdcbdqzm.Sljg = sljg;//受理机关(字典)
                msjxjjdcbdqzm.Cjsj = DateTime.Now.ToString();////信息添加时间
                msjxjjdcbdqzm.Movesign = "0";////是否传输
                msjxjjdcbdqzm.Enabled = "1";////是否有效

                filedkey = Db.TransInsert<MsjXjJdcbdqzm>(msjxjjdcbdqzm);
                mResultModel.result = "ok";
            }
            catch (Exception ex)
            {
                MSEx.DealErr(ex, "实体类的插入操作" + ex.Message.ToString());
                mResultModel.result = "error";
            }
            IsoDateTimeConverter dtConverter = new IsoDateTimeConverter { DateTimeFormat = "yyyy-MM-dd HH:mm:ss" };
            HttpContext.Current.Response.ContentEncoding = System.Text.Encoding.GetEncoding("GB2312");
            var result = JsonUtils.ConvertJsonString(JsonConvert.SerializeObject(mResultModel, dtConverter));
            HttpContext.Current.Response.Write(callback + "(" + result + ")");
            HttpContext.Current.Response.End();
        }
        #endregion
        #endregion

        #region -----法制接口-----全无关联
        #region 国家赔偿申请
        /// <summary>
        ///  国家赔偿申请
        /// </summary>
        [WebMethod]
        public void AddMsjFzGjpcsq()
        {
            object filedkey;
            string callback = HttpContext.Current.Request["para"];
            string sqr = HttpContext.Current.Request["sqr"].FilteHtml();//申请人
            string xb = HttpContext.Current.Request["xb"].FilteHtml();//性别(字典)
            string mz = HttpContext.Current.Request["mz"].FilteHtml();//民族(字典)
            string fr = HttpContext.Current.Request["fr"].FilteHtml();//法人或主要负责人
            string zz = HttpContext.Current.Request["zz"].FilteHtml();//住址
            string sfzh = HttpContext.Current.Request["sfzh"].FilteHtml();//身份证号
            string yzbm = HttpContext.Current.Request["yzbm"].FilteHtml();//邮政编码
            string dh = HttpContext.Current.Request["dh"].FilteHtml();//电话
            string pcywjg = HttpContext.Current.Request["pcywjg"].FilteHtml();//赔偿义务机关
            string pcyq = HttpContext.Current.Request["pcyq"].FilteHtml();//赔偿要求
            string sshly = HttpContext.Current.Request["sshly"].FilteHtml();//事实和理由(简要)
            string qm = HttpContext.Current.Request["qm"].FilteHtml();//申请人签名
            string sqrq = HttpContext.Current.Request["sqrq"].FilteHtml();//申请日期
            string sljg = HttpContext.Current.Request["sljg"].FilteHtml();//受理机关
            AjaxResultModel mResultModel = new AjaxResultModel(); //初始化返回类型
            MsjFzGjpcsq msjfzgjpcsq = new MsjFzGjpcsq();
            try
            {
                msjfzgjpcsq.Sqid = Guid.NewGuid().ToString(); //主键
                msjfzgjpcsq.Sqr = sqr;//申请人
                msjfzgjpcsq.Xb = xb;//性别(字典)
                msjfzgjpcsq.Mz = mz;//民族(字典)
                msjfzgjpcsq.Fr = fr;//法人或主要负责人
                msjfzgjpcsq.Zz = zz;//住址
                msjfzgjpcsq.Sfzh = sfzh;//身份证号
                msjfzgjpcsq.Yzbm = yzbm;//邮政编码
                msjfzgjpcsq.Dh = dh;//电话
                msjfzgjpcsq.Pcywjg = pcywjg;//赔偿义务机关
                msjfzgjpcsq.Pcyq = pcyq;//赔偿要求
                msjfzgjpcsq.Sshly = sshly;//事实和理由(简要)
                msjfzgjpcsq.Qm = qm;//申请人签名
                msjfzgjpcsq.Sqrq = sqrq;//申请日期
                msjfzgjpcsq.Sljg = sljg;//受理机关
                msjfzgjpcsq.Cjsj = DateTime.Now.ToString();////信息添加时间
                msjfzgjpcsq.Movesign = "0";////是否传输
                msjfzgjpcsq.Enabled = "1";////是否有效

                filedkey = Db.TransInsert<MsjFzGjpcsq>(msjfzgjpcsq);
                mResultModel.result = "ok";
            }
            catch (Exception ex)
            {
                MSEx.DealErr(ex, "实体类的插入操作" + ex.Message.ToString());
                mResultModel.result = "error";
            }
            IsoDateTimeConverter dtConverter = new IsoDateTimeConverter { DateTimeFormat = "yyyy-MM-dd HH:mm:ss" };
            HttpContext.Current.Response.ContentEncoding = System.Text.Encoding.GetEncoding("GB2312");
            var result = JsonUtils.ConvertJsonString(JsonConvert.SerializeObject(mResultModel, dtConverter));
            HttpContext.Current.Response.Write(callback + "(" + result + ")");
            HttpContext.Current.Response.End();
        }
        #endregion

        #region 行政复议申请
        /// <summary>
        /// 行政复议申请 
        /// </summary>
        [WebMethod]
        public void AddMsjFzXzfysq()
        {
            object filedkey;
            string callback = HttpContext.Current.Request["para"];
            string sqr = HttpContext.Current.Request["sqr"].FilteHtml();//申请人
            string xb = HttpContext.Current.Request["xb"].FilteHtml();//性别(字典)
            string mz = HttpContext.Current.Request["mz"].FilteHtml();//民族(字典)
            string fr = HttpContext.Current.Request["fr"].FilteHtml();//法人或主要负责人
            string zz = HttpContext.Current.Request["zz"].FilteHtml();//住址
            string sfzh = HttpContext.Current.Request["sfzh"].FilteHtml();//身份证号
            string yzbm = HttpContext.Current.Request["yzbm"].FilteHtml();//邮政编码
            string dh = HttpContext.Current.Request["dh"].FilteHtml();//电话
            string bsqr = HttpContext.Current.Request["bsqr"].FilteHtml();//被申请人
            string fyyq = HttpContext.Current.Request["fyyq"].FilteHtml();//复议要求
            string sshly = HttpContext.Current.Request["sshly"].FilteHtml();//事实和理由(简要)
            string qm = HttpContext.Current.Request["qm"].FilteHtml();//申请人签名
            string sqrq = HttpContext.Current.Request["sqrq"].FilteHtml();//申请日期
            string sljg = HttpContext.Current.Request["sljg"].FilteHtml();//受理机关
            AjaxResultModel mResultModel = new AjaxResultModel(); //初始化返回类型
            MsjFzXzfysq msjfzxzfysq = new MsjFzXzfysq();
            try
            {
                msjfzxzfysq.Sqid = Guid.NewGuid().ToString(); //主键
                msjfzxzfysq.Sqr = sqr;//申请人
                msjfzxzfysq.Xb = xb;//性别(字典)
                msjfzxzfysq.Mz = mz;//民族(字典)
                msjfzxzfysq.Fr = fr;//法人或主要负责人
                msjfzxzfysq.Zz = zz;//住址
                msjfzxzfysq.Sfzh = sfzh;//身份证号
                msjfzxzfysq.Yzbm = yzbm;//邮政编码
                msjfzxzfysq.Dh = dh;//电话
                msjfzxzfysq.Bsqr = bsqr;//被申请人
                msjfzxzfysq.Fyyq = fyyq;//复议要求
                msjfzxzfysq.Sshly = sshly;//事实和理由(简要)
                msjfzxzfysq.Qm = qm;//申请人签名
                msjfzxzfysq.Sqrq = sqrq;//申请日期
                msjfzxzfysq.Sljg = sljg;//受理机关
                msjfzxzfysq.Cjsj = DateTime.Now.ToString();////信息添加时间
                msjfzxzfysq.Movesign = "0";////是否传输
                msjfzxzfysq.Enabled = "1";////是否有效

                filedkey = Db.TransInsert<MsjFzXzfysq>(msjfzxzfysq);
                mResultModel.result = "ok";
            }
            catch (Exception ex)
            {
                MSEx.DealErr(ex, "实体类的插入操作" + ex.Message.ToString());
                mResultModel.result = "error";
            }
            IsoDateTimeConverter dtConverter = new IsoDateTimeConverter { DateTimeFormat = "yyyy-MM-dd HH:mm:ss" };
            HttpContext.Current.Response.ContentEncoding = System.Text.Encoding.GetEncoding("GB2312");
            var result = JsonUtils.ConvertJsonString(JsonConvert.SerializeObject(mResultModel, dtConverter));
            HttpContext.Current.Response.Write(callback + "(" + result + ")");
            HttpContext.Current.Response.End();
        }
        #endregion
        #endregion

        #region -----经文保接口-----1个表关联 完成

        #region 金融金库安全防范设施建设审批及验收----关联1个表 写完未测试
        /// <summary>
        ///  金融金库安全防范设施建设审批及验收
        /// </summary>
        [WebMethod]
        public void AddMsjJwbAqjsffgcsjfa()
        {
            object filedkey1, filedkey2;
            int ysje = 0;
            string callback = HttpContext.Current.Request["para"];
            string people = HttpContext.Current.Request["people"];//工程id
            string dwmc = HttpContext.Current.Request["dwmc"].FilteHtml();//工程名称
            string dz = HttpContext.Current.Request["dz"].FilteHtml();//地址
            string fxdj = HttpContext.Current.Request["fxdj"].FilteHtml();//风险等级
            if (!string.IsNullOrEmpty(HttpContext.Current.Request["ysje"].FilteHtml()))
            {
                ysje = Convert.ToInt32(HttpContext.Current.Request["ysje"].FilteHtml());//预算金额（万元）
            }
            string jsdwmc = HttpContext.Current.Request["jsdwmc"].FilteHtml();//建设单位_名称
            string jsdwxmfzr = HttpContext.Current.Request["jsdwxmfzr"].FilteHtml();//建设单位_项目负责人
            string jsdwdz = HttpContext.Current.Request["jsdwdz"].FilteHtml();//建设单位_地址
            string jsdwlxdh = HttpContext.Current.Request["jsdwlxdh"].FilteHtml();//建设单位_联系电话
            string jsdwshsj = HttpContext.Current.Request["jsdwshsj"].FilteHtml();//建设单位_审核时间
            string jsdwshyj = HttpContext.Current.Request["jsdwshyj"].FilteHtml();//建设单位_审核意见
            string sgdwmc = HttpContext.Current.Request["sgdwmc"].FilteHtml();//施工单位_名称
            string sgdwxmfzr = HttpContext.Current.Request["sgdwxmfzr"].FilteHtml();//施工单位_项目负责人
            string sgdwdz = HttpContext.Current.Request["sgdwdz"].FilteHtml();//施工单位_地址
            string sgdwlxdh = HttpContext.Current.Request["sgdwlxdh"].FilteHtml();//施工单位_联系电话
            string gajgspyj = HttpContext.Current.Request["gajgspyj"].FilteHtml();//公安机关_审批意见
            string gajgshsj = HttpContext.Current.Request["gajgshsj"].FilteHtml();//公安机关_审核时间
            AjaxResultModel mResultModel = new AjaxResultModel(); //初始化返回类型
            MsjJwbAqjsffgcsjfa msjjwbaqjsffgcsjfa = new MsjJwbAqjsffgcsjfa();
            try
            {
                msjjwbaqjsffgcsjfa.Gcid = Guid.NewGuid().ToString(); //主键
                msjjwbaqjsffgcsjfa.Dwmc = dwmc;//工程名称
                msjjwbaqjsffgcsjfa.Dz = dz;//地址
                msjjwbaqjsffgcsjfa.Fxdj = fxdj;//风险等级
                msjjwbaqjsffgcsjfa.Ysje = ysje;//预算金额（万元）
                msjjwbaqjsffgcsjfa.JsdwMc = jsdwmc;//建设单位_名称
                msjjwbaqjsffgcsjfa.JsdwXmfzr = jsdwxmfzr;//建设单位_项目负责人
                msjjwbaqjsffgcsjfa.JsdwDz = jsdwdz;//建设单位_地址
                msjjwbaqjsffgcsjfa.JsdwLxdh = jsdwlxdh;//建设单位_联系电话
                msjjwbaqjsffgcsjfa.JsdwShsj = jsdwshsj;//建设单位_审核时间
                msjjwbaqjsffgcsjfa.JsdwShyj = jsdwshyj;//建设单位_审核意见
                msjjwbaqjsffgcsjfa.SgdwMc = sgdwmc;//施工单位_名称
                msjjwbaqjsffgcsjfa.SgdwXmfzr = sgdwxmfzr;//施工单位_项目负责人
                msjjwbaqjsffgcsjfa.SgdwDz = sgdwdz;//施工单位_地址
                msjjwbaqjsffgcsjfa.SgdwLxdh = sgdwlxdh;//施工单位_联系电话
                msjjwbaqjsffgcsjfa.GajgSpyj = gajgspyj;//公安机关_审批意见
                msjjwbaqjsffgcsjfa.GajgShsj = gajgshsj;//公安机关_审核时间
                msjjwbaqjsffgcsjfa.Cjsj = DateTime.Now.ToString();////信息添加时间
                msjjwbaqjsffgcsjfa.Movesign = "0";////是否传输
                msjjwbaqjsffgcsjfa.Enabled = "1";////是否有效
                filedkey1 = Db.TransInsert<MsjJwbAqjsffgcsjfa>(msjjwbaqjsffgcsjfa);
                if (filedkey1 != null)
                {
                    if (!string.IsNullOrEmpty(people))
                    {
                        var list = JsonConvert.DeserializeObject<List<MsjJwbAqjsffgcZysjry>>(people);
                        foreach (var i in list)
                        {
                            MsjJwbAqjsffgcZysjry mMsjJwbAqjsffgcZysjry = new MsjJwbAqjsffgcZysjry();
                            if (string.IsNullOrEmpty(i.Xm) && string.IsNullOrEmpty(i.Sfzh))
                            {
                                mResultModel.result = "ok";
                            }
                            else
                            {
                                mMsjJwbAqjsffgcZysjry.Gcid = msjjwbaqjsffgcsjfa.Gcid;
                                mMsjJwbAqjsffgcZysjry.Ryid = Guid.NewGuid().ToString();//关联表主键
                                mMsjJwbAqjsffgcZysjry.Xm = i.Xm;//姓名
                                mMsjJwbAqjsffgcZysjry.Zw = i.Zw;//职务
                                mMsjJwbAqjsffgcZysjry.Jszc = i.Jszc;//技术职称
                                mMsjJwbAqjsffgcZysjry.Sfzh = i.Sfzh;//身份证号
                                if (string.IsNullOrEmpty(i.Pxm.ToString()))
                                {
                                    mMsjJwbAqjsffgcZysjry.Pxm = Convert.ToInt32(i.Pxm.ToString());//顺序码
                                }
                                mMsjJwbAqjsffgcZysjry.Cjsj = DateTime.Now.ToString();
                                mMsjJwbAqjsffgcZysjry.Movesign = "0";
                                mMsjJwbAqjsffgcZysjry.Enabled = "1";
                                filedkey2 = Db.TransInsert<MsjJwbAqjsffgcZysjry>(mMsjJwbAqjsffgcZysjry);
                                mResultModel.result = "ok";
                            }
                        }
                    }
                    mResultModel.result = "ok";
                }
                else
                {
                    mResultModel.result = "error";
                }
            }
            catch (Exception ex)
            {
                MSEx.DealErr(ex, "实体类的插入操作" + ex.Message.ToString());
                mResultModel.result = "error";
            }
            IsoDateTimeConverter dtConverter = new IsoDateTimeConverter { DateTimeFormat = "yyyy-MM-dd HH:mm:ss" };
            HttpContext.Current.Response.ContentEncoding = System.Text.Encoding.GetEncoding("GB2312");
            var result = JsonUtils.ConvertJsonString(JsonConvert.SerializeObject(mResultModel, dtConverter));
            HttpContext.Current.Response.Write(callback + "(" + result + ")");
            HttpContext.Current.Response.End();
        }
        #endregion

        #endregion

        #region -----保安接口-----1个表关联

        #region 保安服务企业设立-关联2个表
        /// <summary>
        ///  保安服务企业设立
        /// </summary>
        [WebMethod]
        public void AddMsjBaBafwqysl()
        {
            object filedkey1, filedkey2;
            string callback = HttpContext.Current.Request["para"];
            string people1 = HttpContext.Current.Request["people1"].FilteHtml();//关联股东表
            string people2 = HttpContext.Current.Request["people2"].FilteHtml();//关联管理人员表
            string qymc = HttpContext.Current.Request["qymc"].FilteHtml();//企业名称
            string zcd = HttpContext.Current.Request["zcd"].FilteHtml();//注册地(市县区)数据字典
            string zsxz = HttpContext.Current.Request["zsxz"].FilteHtml();//住所详址
            string yb = HttpContext.Current.Request["yb"].FilteHtml();//邮编
            string fwfw = HttpContext.Current.Request["fwfw"].FilteHtml();//服务范围(字典)
            string lxrxm = HttpContext.Current.Request["lxrxm"].FilteHtml();//联系人姓名
            string gddh = HttpContext.Current.Request["gddh"].FilteHtml();//固定电话
            string sj = HttpContext.Current.Request["sj"].FilteHtml();//手机
            string jjlx = HttpContext.Current.Request["jjlx"].FilteHtml();//经济类型
            string zczb = HttpContext.Current.Request["zczb"].FilteHtml();//注册资本
            string gdsl = HttpContext.Current.Request["gdsl"].FilteHtml();//股东数量
            string frxm = HttpContext.Current.Request["frxm"].FilteHtml();//法人姓名
            string frxb = HttpContext.Current.Request["frxb"].FilteHtml();//法人性别(字典)
            string frgszw = HttpContext.Current.Request["frgszw"].FilteHtml();//法人公司职务
            string frzjmc = HttpContext.Current.Request["frzjmc"].FilteHtml();//法人证件名称
            string frzjhm = HttpContext.Current.Request["frzjhm"].FilteHtml();//法人证件号码
            string frzz = HttpContext.Current.Request["frzz"].FilteHtml();//法人住址
            string frbaszbh = HttpContext.Current.Request["frbaszbh"].FilteHtml();//法人保安师证编号
            string frgddh = HttpContext.Current.Request["frgddh"].FilteHtml();//法人固定电话
            string frsj = HttpContext.Current.Request["frsj"].FilteHtml();//法人手机
            string glryxm = HttpContext.Current.Request["glryxm"].FilteHtml();//管理人一姓名
            string glryzw = HttpContext.Current.Request["glryzw"].FilteHtml();//管理人一职务
            string glryzjmc = HttpContext.Current.Request["glryzjmc"].FilteHtml();//管理人一证件名称
            string glryzjhm = HttpContext.Current.Request["glryzjhm"].FilteHtml();//管理人一证件号码
            string glrybasbh = HttpContext.Current.Request["glrybasbh"].FilteHtml();//管理人一保安师证编号
            string glrexm = HttpContext.Current.Request["glrexm"].FilteHtml();//管理人二姓名
            string glrezw = HttpContext.Current.Request["glrezw"].FilteHtml();//管理人二职务
            string glrezjmc = HttpContext.Current.Request["glrezjmc"].FilteHtml();//管理人二证件名称
            string glrezjhm = HttpContext.Current.Request["glrezjhm"].FilteHtml();//管理人二证件号码
            string glrebasbh = HttpContext.Current.Request["glrebasbh"].FilteHtml();//管理人二保安师证编号
            string glrsxm = HttpContext.Current.Request["glrsxm"].FilteHtml();//管理人三姓名
            string glrszw = HttpContext.Current.Request["glrszw"].FilteHtml();//管理人三职务
            string glrszjmc = HttpContext.Current.Request["glrszjmc"].FilteHtml();//管理人三证件名称
            string glrszjhm = HttpContext.Current.Request["glrszjhm"].FilteHtml();//管理人三证件号码
            string glrsbasbh = HttpContext.Current.Request["glrsbasbh"].FilteHtml();//管理人三保安师证编号
            string frqm = HttpContext.Current.Request["frqm"].FilteHtml();//法人签名
            string qmrq = HttpContext.Current.Request["qmrq"].FilteHtml();//签名日期
            AjaxResultModel mResultModel = new AjaxResultModel(); //初始化返回类型
            MsjBaBafwqysl msjbabafwqysl = new MsjBaBafwqysl();
            try
            {
                msjbabafwqysl.Qyid = Guid.NewGuid().ToString(); //主键
                msjbabafwqysl.Qymc = qymc;//企业名称
                msjbabafwqysl.Zcd = zcd;//注册地(市县区)数据字典
                msjbabafwqysl.Zsxz = zsxz;//住所详址
                msjbabafwqysl.Yb = yb;//邮编
                msjbabafwqysl.Fwfw = fwfw;//服务范围(字典)
                msjbabafwqysl.Lxrxm = lxrxm;//联系人姓名
                msjbabafwqysl.Gddh = gddh;//固定电话
                msjbabafwqysl.Sj = sj;//手机
                msjbabafwqysl.Jjlx = jjlx;//经济类型
                msjbabafwqysl.Zczb = zczb;//注册资本
                msjbabafwqysl.Gdsl = gdsl;//股东数量
                msjbabafwqysl.Frxm = frxm;//法人姓名
                msjbabafwqysl.Frxb = frxb;//法人性别(字典)
                msjbabafwqysl.Frgszw = frgszw;//法人公司职务
                msjbabafwqysl.Frzjmc = frzjmc;//法人证件名称
                msjbabafwqysl.Frzjhm = frzjhm;//法人证件号码
                msjbabafwqysl.Frzz = frzz;//法人住址
                msjbabafwqysl.Frbaszbh = frbaszbh;//法人保安师证编号
                msjbabafwqysl.Frgddh = frgddh;//法人固定电话
                msjbabafwqysl.Frsj = frsj;//法人手机
                msjbabafwqysl.Glryxm = glryxm;//管理人一姓名
                msjbabafwqysl.Glryzw = glryzw;//管理人一职务
                msjbabafwqysl.Glryzjmc = glryzjmc;//管理人一证件名称
                msjbabafwqysl.Glryzjhm = glryzjhm;//管理人一证件号码
                msjbabafwqysl.Glrybasbh = glrybasbh;//管理人一保安师证编号
                msjbabafwqysl.Glrexm = glrexm;//管理人二姓名
                msjbabafwqysl.Glrezw = glrezw;//管理人二职务
                msjbabafwqysl.Glrezjmc = glrezjmc;//管理人二证件名称
                msjbabafwqysl.Glrezjhm = glrezjhm;//管理人二证件号码
                msjbabafwqysl.Glrebasbh = glrebasbh;//管理人二保安师证编号
                msjbabafwqysl.Glrsxm = glrsxm;//管理人三姓名
                msjbabafwqysl.Glrszw = glrszw;//管理人三职务
                msjbabafwqysl.Glrszjmc = glrszjmc;//管理人三证件名称
                msjbabafwqysl.Glrszjhm = glrszjhm;//管理人三证件号码
                msjbabafwqysl.Glrsbasbh = glrsbasbh;//管理人三保安师证编号
                msjbabafwqysl.Frqm = frqm;//法人签名
                msjbabafwqysl.Qmrq = qmrq;//签名日期
                msjbabafwqysl.Cjsj = DateTime.Now.ToString();////信息添加时间
                msjbabafwqysl.Movesign = "0";////是否传输
                msjbabafwqysl.Enabled = "1";////是否有效
                filedkey1 = Db.TransInsert<MsjBaBafwqysl>(msjbabafwqysl);
                if (filedkey1 != null)
                {
                    if (!string.IsNullOrEmpty(people1))
                    {
                        var list1 = JsonConvert.DeserializeObject<List<MsjBaBafwqyZygd>>(people1);//股东表
                        foreach (var i in list1)
                        {
                            if (string.IsNullOrEmpty(i.Dwhxm.FilteHtml()))
                            {
                                mResultModel.result = "ok";
                            }
                            else
                            {
                                MsjBaBafwqyZygd mMsjBaBafwqyZygd = new MsjBaBafwqyZygd();
                                mMsjBaBafwqyZygd.Gdid = Guid.NewGuid().ToString();//股东表主键股东id
                                mMsjBaBafwqyZygd.Qyid = msjbabafwqysl.Qyid;//关联表企业id
                                mMsjBaBafwqyZygd.Dwhxm = i.Dwhxm.FilteHtml();//单位或姓名
                                mMsjBaBafwqyZygd.Dwxzgrgj = i.Dwxzgrgj.FilteHtml();//单位性质个人国籍
                                mMsjBaBafwqyZygd.Zjmc = i.Zjmc.FilteHtml();//证件名称
                                mMsjBaBafwqyZygd.Zjhm = i.Zjhm.FilteHtml();//证件号码
                                mMsjBaBafwqyZygd.Czje = i.Czje;//出资金额
                                mMsjBaBafwqyZygd.Gfbl = i.Gfbl;//股份所占比例
                                mMsjBaBafwqyZygd.Pxm = i.Pxm;//顺序码
                                mMsjBaBafwqyZygd.Cjsj = DateTime.Now.ToString();
                                mMsjBaBafwqyZygd.Movesign = "0";
                                mMsjBaBafwqyZygd.Enabled = "1";
                                filedkey2 = Db.TransInsert<MsjBaBafwqyZygd>(mMsjBaBafwqyZygd);
                                mResultModel.result = "ok";
                            }
                        }
                    }
                    if (!string.IsNullOrEmpty(people2))
                    {
                        var list2 = JsonConvert.DeserializeObject<List<MsjBaBafwqyZyglry>>(people2);//管理人员表
                        foreach (var j in list2)
                        {
                            if (string.IsNullOrEmpty(j.Xm.FilteHtml()) && string.IsNullOrEmpty(j.Zjhm.FilteHtml()))
                            {
                                mResultModel.result = "ok";
                            }
                            else
                            {
                                MsjBaBafwqyZyglry mMsjBaBafwqyZyglry = new MsjBaBafwqyZyglry();
                                mMsjBaBafwqyZyglry.Glryid = Guid.NewGuid().ToString();//管理人员表主键管理人员id
                                mMsjBaBafwqyZyglry.Qyid = msjbabafwqysl.Qyid;//关联表企业id
                                mMsjBaBafwqyZyglry.Xm = j.Xm.FilteHtml();//姓名
                                mMsjBaBafwqyZyglry.Zw = j.Zw.FilteHtml();//职务
                                mMsjBaBafwqyZyglry.Zjmc = j.Zjmc.FilteHtml();//证件名称
                                mMsjBaBafwqyZyglry.Zjhm = j.Zjhm.FilteHtml();//证件号码
                                mMsjBaBafwqyZyglry.Baszbh = j.Baszbh;//保安师证编号
                                mMsjBaBafwqyZyglry.Pxm = j.Pxm;//顺序码
                                mMsjBaBafwqyZyglry.Cjsj = DateTime.Now.ToString();
                                mMsjBaBafwqyZyglry.Movesign = "0";
                                mMsjBaBafwqyZyglry.Enabled = "1";
                                filedkey2 = Db.TransInsert<MsjBaBafwqyZyglry>(mMsjBaBafwqyZyglry);
                                mResultModel.result = "ok";
                            }
                        }
                    }
                    mResultModel.result = "ok";
                }
                else
                {
                    mResultModel.result = "error";
                }
            }
            catch (Exception ex)
            {
                MSEx.DealErr(ex, "实体类的插入操作" + ex.Message.ToString());
                mResultModel.result = "error";
            }
            IsoDateTimeConverter dtConverter = new IsoDateTimeConverter { DateTimeFormat = "yyyy-MM-dd HH:mm:ss" };
            HttpContext.Current.Response.ContentEncoding = System.Text.Encoding.GetEncoding("GB2312");
            var result = JsonUtils.ConvertJsonString(JsonConvert.SerializeObject(mResultModel, dtConverter));
            HttpContext.Current.Response.Write(callback + "(" + result + ")");
            HttpContext.Current.Response.End();
        }
        #endregion

        #region 单位自行招聘保安员备案
        /// <summary>
        ///  单位自行招聘保安员备案
        /// </summary>
        [WebMethod]
        public void AddMsjBaDwzxzpbayba()
        {
            object filedkey;
            int bayrs = 0;
            string callback = HttpContext.Current.Request["para"];
            string dwmc = HttpContext.Current.Request["dwmc"].FilteHtml();//单位名称
            string gsxz = HttpContext.Current.Request["gsxz"].FilteHtml();//公司详址
            string yzbm = HttpContext.Current.Request["yzbm"].FilteHtml();//邮政编码
            string fddbr = HttpContext.Current.Request["fddbr"].FilteHtml();//法定代表人
            string frdh = HttpContext.Current.Request["frdh"].FilteHtml();//法人电话
            string frsj = HttpContext.Current.Request["frsj"].FilteHtml();//法人手机
            string fgfzr = HttpContext.Current.Request["fgfzr"].FilteHtml();//分管负责人
            string fgfzrdh = HttpContext.Current.Request["fgfzrdh"].FilteHtml();//分管负责人电话
            string fgfzrsj = HttpContext.Current.Request["fgfzrsj"].FilteHtml();//分管负责人手机
            string lxr = HttpContext.Current.Request["lxr"].FilteHtml();//联系人
            string lxrdh = HttpContext.Current.Request["lxrdh"].FilteHtml();//联系人电话
            string lxrsj = HttpContext.Current.Request["lxrsj"].FilteHtml();//联系人手机
            if (!string.IsNullOrEmpty(HttpContext.Current.Request["bayrs"].FilteHtml()))
            {
                bayrs = Convert.ToInt32(HttpContext.Current.Request["bayrs"].FilteHtml());//保安员人数
            }
            string dwlx = HttpContext.Current.Request["dwlx"].FilteHtml();//单位类型
            string pywygaydwmc = HttpContext.Current.Request["pywygaydwmc"].FilteHtml();//聘用物业保安员单位名称
            string pywybaygsxz = HttpContext.Current.Request["pywybaygsxz"].FilteHtml();//聘用物业保安员公司详址
            string pyyzbm = HttpContext.Current.Request["pyyzbm"].FilteHtml();//聘用邮政编码
            string pywybayfgfzr = HttpContext.Current.Request["pywybayfgfzr"].FilteHtml();//聘用物业保安员分管负责人
            string pyfzrdh = HttpContext.Current.Request["pyfzrdh"].FilteHtml();//聘用负责人电话
            string pyfzrsj = HttpContext.Current.Request["pyfzrsj"].FilteHtml();//聘用负责人手机
            string pywybaylxr = HttpContext.Current.Request["pywybaylxr"].FilteHtml();//聘用物业保安员联系人
            string pylxrdh = HttpContext.Current.Request["pylxrdh"].FilteHtml();//聘用联系人电话
            string pylxrsj = HttpContext.Current.Request["pylxrsj"].FilteHtml();//聘用联系人手机
            AjaxResultModel mResultModel = new AjaxResultModel(); //初始化返回类型
            MsjBaDwzxzpbayba msjbadwzxzpbayba = new MsjBaDwzxzpbayba();
            try
            {
                msjbadwzxzpbayba.Sqid = Guid.NewGuid().ToString(); //主键
                msjbadwzxzpbayba.Dwmc = dwmc;//单位名称
                msjbadwzxzpbayba.Gsxz = gsxz;//公司详址
                msjbadwzxzpbayba.Yzbm = yzbm;//邮政编码
                msjbadwzxzpbayba.Fddbr = fddbr;//法定代表人
                msjbadwzxzpbayba.Frdh = frdh;//法人电话
                msjbadwzxzpbayba.Frsj = frsj;//法人手机
                msjbadwzxzpbayba.Fgfzr = fgfzr;//分管负责人
                msjbadwzxzpbayba.Fgfzrdh = fgfzrdh;//分管负责人电话
                msjbadwzxzpbayba.Fgfzrsj = fgfzrsj;//分管负责人手机
                msjbadwzxzpbayba.Lxr = lxr;//联系人
                msjbadwzxzpbayba.Lxrdh = lxrdh;//联系人电话
                msjbadwzxzpbayba.Lxrsj = lxrsj;//联系人手机
                msjbadwzxzpbayba.Bayrs = bayrs;//保安员人数
                msjbadwzxzpbayba.Dwlx = dwlx;//单位类型
                msjbadwzxzpbayba.Pywygaydwmc = pywygaydwmc;//聘用物业保安员单位名称
                msjbadwzxzpbayba.Pywybaygsxz = pywybaygsxz;//聘用物业保安员公司详址
                msjbadwzxzpbayba.Pyyzbm = pyyzbm;//聘用邮政编码
                msjbadwzxzpbayba.Pywybayfgfzr = pywybayfgfzr;//聘用物业保安员分管负责人
                msjbadwzxzpbayba.Pyfzrdh = pyfzrdh;//聘用负责人电话
                msjbadwzxzpbayba.Pyfzrsj = pyfzrsj;//聘用负责人手机
                msjbadwzxzpbayba.Pywybaylxr = pywybaylxr;//聘用物业保安员联系人
                msjbadwzxzpbayba.Pylxrdh = pylxrdh;//聘用联系人电话
                msjbadwzxzpbayba.Pylxrsj = pylxrsj;//聘用联系人手机
                msjbadwzxzpbayba.Cjsj = DateTime.Now.ToString();////信息添加时间
                msjbadwzxzpbayba.Movesign = "0";////是否传输
                msjbadwzxzpbayba.Enabled = "1";////是否有效

                filedkey = Db.TransInsert<MsjBaDwzxzpbayba>(msjbadwzxzpbayba);
                mResultModel.result = "ok";
                mResultModel.data = msjbadwzxzpbayba;
            }
            catch (Exception ex)
            {
                MSEx.DealErr(ex, "实体类的插入操作" + ex.Message.ToString());
                mResultModel.result = "error";
            }
            IsoDateTimeConverter dtConverter = new IsoDateTimeConverter { DateTimeFormat = "yyyy-MM-dd HH:mm:ss" };
            HttpContext.Current.Response.ContentEncoding = System.Text.Encoding.GetEncoding("GB2312");
            var result = JsonUtils.ConvertJsonString(JsonConvert.SerializeObject(mResultModel, dtConverter));
            HttpContext.Current.Response.Write(callback + "(" + result + ")");
            HttpContext.Current.Response.End();
        }
        #endregion

        #region 申请办理保安员证
        /// <summary>
        ///  申请办理保安员证
        /// </summary>
        [WebMethod]
        public void AddMsjBaSqblbayz()
        {
            object filedkey;
            int sg = 0;
            int kscj = 0;
            string callback = HttpContext.Current.Request["para"];
            string xm = HttpContext.Current.Request["xm"].FilteHtml();//姓名
            string xb = HttpContext.Current.Request["xb"].FilteHtml();//性别(字典)
            string zzmm = HttpContext.Current.Request["zzmm"].FilteHtml();//政治面貌(字典)
            string cym = HttpContext.Current.Request["cym"].FilteHtml();//曾用名
            string mz = HttpContext.Current.Request["mz"].FilteHtml();//民族(字典)
            string hyzk = HttpContext.Current.Request["hyzk"].FilteHtml();//婚姻状况(字典)
            string whcd = HttpContext.Current.Request["whcd"].FilteHtml();//文化程度(字典)
            string xx = HttpContext.Current.Request["xx"].FilteHtml();//血型(字典)
            string byzk = HttpContext.Current.Request["byzk"].FilteHtml();//兵役状况
            string csrq = HttpContext.Current.Request["csrq"].FilteHtml();//出生日期
            if (!string.IsNullOrEmpty(HttpContext.Current.Request["sg"].FilteHtml()))
            {
                sg = Convert.ToInt32(HttpContext.Current.Request["sg"].FilteHtml());//身高
            }
            string jkzk = HttpContext.Current.Request["jkzk"].FilteHtml();//健康状况(字典)
            string sfzh = HttpContext.Current.Request["sfzh"].FilteHtml();//身份证号
            string dh = HttpContext.Current.Request["dh"].FilteHtml();//电话
            string sj = HttpContext.Current.Request["sj"].FilteHtml();//手机
            string jg = HttpContext.Current.Request["jg"].FilteHtml();//籍贯(字典)
            string hjdxz = HttpContext.Current.Request["hjdxz"].FilteHtml();//户籍地详址
            string hjdxq = HttpContext.Current.Request["hjdxq"].FilteHtml();//户籍地辖区
            string xzdxz = HttpContext.Current.Request["xzdxz"].FilteHtml();//现住地详址
            string xzdxq = HttpContext.Current.Request["xzdxq"].FilteHtml();//现住地辖区
            string gajgsh = HttpContext.Current.Request["gajgsh"].FilteHtml();//公安机关审核
            if (!string.IsNullOrEmpty(HttpContext.Current.Request["kscj"].FilteHtml()))
            {
                kscj = Convert.ToInt32(HttpContext.Current.Request["kscj"].FilteHtml());//考试成绩
            }
            string gzbm = HttpContext.Current.Request["gzbm"].FilteHtml();//工作部门
            string baygw = HttpContext.Current.Request["baygw"].FilteHtml();//保安员岗位
            string rzsj = HttpContext.Current.Request["rzsj"].FilteHtml();//入职时间
            string lzrq = HttpContext.Current.Request["lzrq"].FilteHtml();//离职日期
            string lzyy = HttpContext.Current.Request["lzyy"].FilteHtml();//离职原因
            string jzzzh = HttpContext.Current.Request["jzzzh"].FilteHtml();//居(暂)住证号
            string sfqdldht = HttpContext.Current.Request["sfqdldht"].FilteHtml();//是否签订劳动合同(1是  0否)
            string sfcjsb = HttpContext.Current.Request["sfcjsb"].FilteHtml();//是否参加社保(1是  0否)
            string baybh = HttpContext.Current.Request["baybh"].FilteHtml();//保安员编号
            string fzjg = HttpContext.Current.Request["fzjg"].FilteHtml();//发证机关
            string fzrq = HttpContext.Current.Request["fzrq"].FilteHtml();//发证日期
            string bayzydj = HttpContext.Current.Request["bayzydj"].FilteHtml();//保安员职业等级
            string zydjfzjg = HttpContext.Current.Request["zydjfzjg"].FilteHtml();//职业等级发证机关
            string zydjfzrq = HttpContext.Current.Request["zydjfzrq"].FilteHtml();//职业等级发证日期
            string jszh = HttpContext.Current.Request["jszh"].FilteHtml();//驾驶证号
            string zjcx = HttpContext.Current.Request["zjcx"].FilteHtml();//准驾车型
            string jszfzrq = HttpContext.Current.Request["jszfzrq"].FilteHtml();//驾驶证发证日期
            string cqzbh = HttpContext.Current.Request["cqzbh"].FilteHtml();//公务用枪持枪证编号
            string cqzqx = HttpContext.Current.Request["cqzqx"].FilteHtml();//公务用枪持枪证枪型
            string cqzfzrq = HttpContext.Current.Request["cqzfzrq"].FilteHtml();//持枪证发证日期
            string cqzyxqx = HttpContext.Current.Request["cqzyxqx"].FilteHtml();//持枪证有效期限
            string cqzfzjg = HttpContext.Current.Request["cqzfzjg"].FilteHtml();//持枪证发证机关
            string zwbh = HttpContext.Current.Request["zwbh"].FilteHtml();//指纹编号
            string baybh2 = HttpContext.Current.Request["baybh2"].FilteHtml();//保安员编号2
            string rylx = HttpContext.Current.Request["rylx"].FilteHtml();//人员类型
            string gsbh = HttpContext.Current.Request["gsbh"].FilteHtml();//公司编号
            string gsmc = HttpContext.Current.Request["gsmc"].FilteHtml();//公司名称
            string slrqm = HttpContext.Current.Request["slrqm"].FilteHtml();//申领人签名
            string qmrq = HttpContext.Current.Request["qmrq"].FilteHtml();//签名日期
            //string zp = HttpContext.Current.Request["zp"].FilteHtml();//照片
            AjaxResultModel mResultModel = new AjaxResultModel(); //初始化返回类型
            MsjBaSqblbayz msjbasqblbayz = new MsjBaSqblbayz();
            try
            {
                msjbasqblbayz.Sqid = Guid.NewGuid().ToString(); //主键
                msjbasqblbayz.Xm = xm;//姓名
                msjbasqblbayz.Xb = xb;//性别(字典)
                msjbasqblbayz.Zzmm = zzmm;//政治面貌(字典)
                msjbasqblbayz.Cym = cym;//曾用名
                msjbasqblbayz.Mz = mz;//民族(字典)
                msjbasqblbayz.Hyzk = hyzk;//婚姻状况(字典)
                msjbasqblbayz.Whcd = whcd;//文化程度(字典)
                msjbasqblbayz.Xx = xx;//血型(字典)
                msjbasqblbayz.Byzk = byzk;//兵役状况
                msjbasqblbayz.Csrq = csrq;//出生日期
                msjbasqblbayz.Sg = sg;//身高
                msjbasqblbayz.Jkzk = jkzk;//健康状况(字典)
                msjbasqblbayz.Sfzh = sfzh;//身份证号
                msjbasqblbayz.Dh = dh;//电话
                msjbasqblbayz.Sj = sj;//手机
                msjbasqblbayz.Jg = jg;//籍贯(字典)
                msjbasqblbayz.Hjdxz = hjdxz;//户籍地详址
                msjbasqblbayz.Hjdxq = hjdxq;//户籍地辖区
                msjbasqblbayz.Xzdxz = xzdxz;//现住地详址
                msjbasqblbayz.Xzdxq = xzdxq;//现住地辖区
                msjbasqblbayz.Gajgsh = gajgsh;//公安机关审核
                msjbasqblbayz.Kscj = kscj;//考试成绩
                msjbasqblbayz.Gzbm = gzbm;//工作部门
                msjbasqblbayz.Baygw = baygw;//保安员岗位
                msjbasqblbayz.Rzsj = rzsj;//入职时间
                msjbasqblbayz.Lzrq = lzrq;//离职日期
                msjbasqblbayz.Lzyy = lzyy;//离职原因
                msjbasqblbayz.Jzzzh = jzzzh;//居(暂)住证号
                msjbasqblbayz.Sfqdldht = sfqdldht;//是否签订劳动合同(1是  0否)
                msjbasqblbayz.Sfcjsb = sfcjsb;//是否参加社保(1是  0否)
                msjbasqblbayz.Baybh = baybh;//保安员编号
                msjbasqblbayz.Fzjg = fzjg;//发证机关
                msjbasqblbayz.Fzrq = fzrq;//发证日期
                msjbasqblbayz.Bayzydj = bayzydj;//保安员职业等级
                msjbasqblbayz.Zydjfzjg = zydjfzjg;//职业等级发证机关
                msjbasqblbayz.Zydjfzrq = zydjfzrq;//职业等级发证日期
                msjbasqblbayz.Jszh = jszh;//驾驶证号
                msjbasqblbayz.Zjcx = zjcx;//准驾车型
                msjbasqblbayz.Jszfzrq = jszfzrq;//驾驶证发证日期
                msjbasqblbayz.Cqzbh = cqzbh;//公务用枪持枪证编号
                msjbasqblbayz.Cqzqx = cqzqx;//公务用枪持枪证枪型
                msjbasqblbayz.Cqzfzrq = cqzfzrq;//持枪证发证日期
                msjbasqblbayz.Cqzyxqx = cqzyxqx;//持枪证有效期限
                msjbasqblbayz.Cqzfzjg = cqzfzjg;//持枪证发证机关
                msjbasqblbayz.Zwbh = zwbh;//指纹编号
                msjbasqblbayz.Baybh2 = baybh2;//保安员编号2
                msjbasqblbayz.Rylx = rylx;//人员类型
                msjbasqblbayz.Gsbh = gsbh;//公司编号
                msjbasqblbayz.Gsmc = gsmc;//公司名称
                msjbasqblbayz.Slrqm = slrqm;//申领人签名
                msjbasqblbayz.Qmrq = qmrq;//签名日期
                //msjbasqblbayz.Zp = zp;//照片
                msjbasqblbayz.Cjsj = DateTime.Now.ToString();////信息添加时间
                msjbasqblbayz.Movesign = "0";////是否传输
                msjbasqblbayz.Enabled = "1";////是否有效

                filedkey = Db.TransInsert<MsjBaSqblbayz>(msjbasqblbayz);
                mResultModel.result = "ok";
                mResultModel.data = msjbasqblbayz;
            }
            catch (Exception ex)
            {
                MSEx.DealErr(ex, "实体类的插入操作" + ex.Message.ToString());
                mResultModel.result = "error";
            }
            IsoDateTimeConverter dtConverter = new IsoDateTimeConverter { DateTimeFormat = "yyyy-MM-dd HH:mm:ss" };
            HttpContext.Current.Response.ContentEncoding = System.Text.Encoding.GetEncoding("GB2312");
            var result = JsonUtils.ConvertJsonString(JsonConvert.SerializeObject(mResultModel, dtConverter));
            HttpContext.Current.Response.Write(callback + "(" + result + ")");
            HttpContext.Current.Response.End();
        }
        #endregion

        #region 申请设立保安培训单位
        /// <summary>
        ///  申请设立保安培训单位
        /// </summary>
        [WebMethod]
        public void AddMsjBaSqslbapxdw()
        {
            object filedkey;
            int szrs = 0, zzszrs = 0, xymj = 0, xsmj = 0, zczj = 0;
            string callback = HttpContext.Current.Request["para"];
            string sqrxm = HttpContext.Current.Request["sqrxm"].FilteHtml();//申请人名称
            string sqrdz = HttpContext.Current.Request["sqrdz"].FilteHtml();//申请人地址
            string sqlxr = HttpContext.Current.Request["sqlxr"].FilteHtml();//申请联系人
            string mc = HttpContext.Current.Request["mc"].FilteHtml();//名称
            string dz = HttpContext.Current.Request["dz"].FilteHtml();//地址
            string xzyz = HttpContext.Current.Request["xzyz"].FilteHtml();//校长院长
            string xzlxdh = HttpContext.Current.Request["xzlxdh"].FilteHtml();//校长联系电话
            string fddbr = HttpContext.Current.Request["fddbr"].FilteHtml();//法定代表人
            string fddbrlxdh = HttpContext.Current.Request["fddbrlxdh"].FilteHtml();//法定代表人联系电话
            if (!string.IsNullOrEmpty(HttpContext.Current.Request["szrs"].FilteHtml()))
            {
                szrs = Convert.ToInt32(HttpContext.Current.Request["szrs"].FilteHtml());//师资人数
            }
            if (!string.IsNullOrEmpty(HttpContext.Current.Request["zzszrs"].FilteHtml()))
            {
                zzszrs = Convert.ToInt32(HttpContext.Current.Request["zzszrs"].FilteHtml());//专职师资人数
            }

            string pxlx = HttpContext.Current.Request["pxlx"].FilteHtml();//培训类型
            string pygm = HttpContext.Current.Request["pygm"].FilteHtml();//培养规模
            if (!string.IsNullOrEmpty(HttpContext.Current.Request["xymj"].FilteHtml()))
            {
                xymj = Convert.ToInt32(HttpContext.Current.Request["xymj"].FilteHtml());//校园面积(平方米)
            }
            if (!string.IsNullOrEmpty(HttpContext.Current.Request["xsmj"].FilteHtml()))
            {
                xsmj = Convert.ToInt32(HttpContext.Current.Request["xsmj"].FilteHtml());//校舍面积(平方米)
            }
            if (!string.IsNullOrEmpty(HttpContext.Current.Request["zczj"].FilteHtml()))
            {
                zczj = Convert.ToInt32(HttpContext.Current.Request["zczj"].FilteHtml());//注册资金(万元)
            }
            string tzlx = HttpContext.Current.Request["tzlx"].FilteHtml();//投资类型
            string shijgajgyj = HttpContext.Current.Request["shijgajgyj"].FilteHtml();//市级人民政府公安机关意见
            string shijspr = HttpContext.Current.Request["shijspr"].FilteHtml();//市级审批人
            string shijspsj = HttpContext.Current.Request["shijspsj"].FilteHtml();//市级审批时间
            string sjgajgyj = HttpContext.Current.Request["sjgajgyj"].FilteHtml();//省级人民政府公安机关意见
            string sjspr = HttpContext.Current.Request["sjspr"].FilteHtml();//省级审批人
            string sjspsj = HttpContext.Current.Request["sjspsj"].FilteHtml();//省级审批时间
            AjaxResultModel mResultModel = new AjaxResultModel(); //初始化返回类型
            MsjBaSqslbapxdw msjbasqslbapxdw = new MsjBaSqslbapxdw();
            try
            {
                msjbasqslbapxdw.Sqid = Guid.NewGuid().ToString(); //主键
                msjbasqslbapxdw.Sqrxm = sqrxm;//申请人名称
                msjbasqslbapxdw.Sqrdz = sqrdz;//申请人地址
                msjbasqslbapxdw.Sqlxr = sqlxr;//申请联系人
                msjbasqslbapxdw.Mc = mc;//名称
                msjbasqslbapxdw.Dz = dz;//地址
                msjbasqslbapxdw.Xzyz = xzyz;//校长院长
                msjbasqslbapxdw.Xzlxdh = xzlxdh;//校长联系电话
                msjbasqslbapxdw.Fddbr = fddbr;//法定代表人
                msjbasqslbapxdw.Fddbrlxdh = fddbrlxdh;//法定代表人联系电话
                msjbasqslbapxdw.Szrs = szrs;//师资人数
                msjbasqslbapxdw.Zzszrs = zzszrs;//专职师资人数
                msjbasqslbapxdw.Pxlx = pxlx;//培训类型
                msjbasqslbapxdw.Pygm = pygm;//培养规模
                msjbasqslbapxdw.Xymj = xymj;//校园面积(平方米)
                msjbasqslbapxdw.Xsmj = xsmj;//校舍面积(平方米)
                msjbasqslbapxdw.Zczj = zczj;//注册资金(万元)
                msjbasqslbapxdw.Tzlx = tzlx;//投资类型
                msjbasqslbapxdw.Shijgajgyj = shijgajgyj;//市级人民政府公安机关意见
                msjbasqslbapxdw.Shijspr = shijspr;//市级审批人
                msjbasqslbapxdw.Shijspsj = shijspsj;//市级审批时间
                msjbasqslbapxdw.Sjgajgyj = sjgajgyj;//省级人民政府公安机关意见
                msjbasqslbapxdw.Sjspr = sjspr;//省级审批人
                msjbasqslbapxdw.Sjspsj = sjspsj;//省级审批时间
                msjbasqslbapxdw.Cjsj = DateTime.Now.ToString();////信息添加时间
                msjbasqslbapxdw.Movesign = "0";////是否传输
                msjbasqslbapxdw.Enabled = "1";////是否有效

                filedkey = Db.TransInsert<MsjBaSqslbapxdw>(msjbasqslbapxdw);
                mResultModel.result = "ok";
                mResultModel.data = msjbasqslbapxdw;
            }
            catch (Exception ex)
            {
                MSEx.DealErr(ex, "实体类的插入操作" + ex.Message.ToString());
                mResultModel.result = "error";
            }
            IsoDateTimeConverter dtConverter = new IsoDateTimeConverter { DateTimeFormat = "yyyy-MM-dd HH:mm:ss" };
            HttpContext.Current.Response.ContentEncoding = System.Text.Encoding.GetEncoding("GB2312");
            var result = JsonUtils.ConvertJsonString(JsonConvert.SerializeObject(mResultModel, dtConverter));
            HttpContext.Current.Response.Write(callback + "(" + result + ")");
            HttpContext.Current.Response.End();
        }
        #endregion

        #endregion

        #region -----网警接口-----无关联

        #region 网上备案
        /// <summary>
        ///  网上备案
        /// </summary>
        [WebMethod]
        public void AddMsjWjWsba()
        {
            object filedkey;
            string callback = HttpContext.Current.Request["para"];
            string dwbh = HttpContext.Current.Request["dwbh"].FilteHtml();//单位编号
            string dwmc = HttpContext.Current.Request["dwmc"].FilteHtml();//单位(个人)名称
            string dwdz = HttpContext.Current.Request["dwdz"].FilteHtml();//单位地址
            string sjzgbm = HttpContext.Current.Request["sjzgbm"].FilteHtml();//上级主管部门（选择）
            string jyxz = HttpContext.Current.Request["jyxz"].FilteHtml();//经营性质(数据字典)
            string sfzh = HttpContext.Current.Request["sfzh"].FilteHtml();//公民身份证号
            string frxm = HttpContext.Current.Request["frxm"].FilteHtml();//法人（负责人）
            string lxdh = HttpContext.Current.Request["lxdh"].FilteHtml();//联系电话
            string zafzr = HttpContext.Current.Request["zafzr"].FilteHtml();//治安负责人
            string yyzzzchm = HttpContext.Current.Request["yyzzzchm"].FilteHtml();//经营范围-主营
            string gajgdjsj = HttpContext.Current.Request["gajgdjsj"].FilteHtml();//经营范围-兼营
            string gajgjsr = HttpContext.Current.Request["gajgjsr"].FilteHtml();//是否具备许可条件
            string qyjbr = HttpContext.Current.Request["qyjbr"].FilteHtml();//材料是否齐全
            AjaxResultModel mResultModel = new AjaxResultModel(); //初始化返回类型
            MsjWjWsba msjwjwsba = new MsjWjWsba();
            try
            {
                msjwjwsba.Dwid = Guid.NewGuid().ToString(); //主键
                msjwjwsba.Dwbh = dwbh;//单位编号
                msjwjwsba.Dwmc = dwmc;//单位(个人)名称
                msjwjwsba.Dwdz = dwdz;//单位地址
                msjwjwsba.Sjzgbm = sjzgbm;//上级主管部门（选择）
                msjwjwsba.Jyxz = jyxz;//经营性质(数据字典)
                msjwjwsba.Sfzh = sfzh;//公民身份证号
                msjwjwsba.Frxm = frxm;//法人（负责人）
                msjwjwsba.Lxdh = lxdh;//联系电话
                msjwjwsba.Zafzr = zafzr;//治安负责人
                msjwjwsba.Yyzzzchm = yyzzzchm;//经营范围-主营
                msjwjwsba.Gajgdjsj = gajgdjsj;//经营范围-兼营
                msjwjwsba.Gajgjsr = gajgjsr;//是否具备许可条件
                msjwjwsba.Qyjbr = qyjbr;//材料是否齐全
                msjwjwsba.Cjsj = DateTime.Now.ToString();////信息添加时间
                msjwjwsba.Movesign = "0";////是否传输
                msjwjwsba.Enabled = "1";////是否有效

                filedkey = Db.TransInsert<MsjWjWsba>(msjwjwsba);
                mResultModel.result = "ok";
                mResultModel.data = msjwjwsba;
            }
            catch (Exception ex)
            {
                MSEx.DealErr(ex, "实体类的插入操作" + ex.Message.ToString());
                mResultModel.result = "error";
            }
            IsoDateTimeConverter dtConverter = new IsoDateTimeConverter { DateTimeFormat = "yyyy-MM-dd HH:mm:ss" };
            HttpContext.Current.Response.ContentEncoding = System.Text.Encoding.GetEncoding("GB2312");
            var result = JsonUtils.ConvertJsonString(JsonConvert.SerializeObject(mResultModel, dtConverter));
            HttpContext.Current.Response.Write(callback + "(" + result + ")");
            HttpContext.Current.Response.End();
        }
        #endregion

        #endregion

        #region -----户政接口-----2个表关联
        #region 收养子女落户
        /// <summary>
        ///  收养子女落户
        /// </summary>
        [WebMethod]
        public void AddMsjHzSyznlh()
        {
            object filedkey;
            int fqnl = 0, mqnl = 0, jtnsr = 0, xyznqk = 0, nl = 0;
            string callback = HttpContext.Current.Request["para"];
            string fqxm = HttpContext.Current.Request["fqxm"].FilteHtml();//父亲姓名
            string fqxb = HttpContext.Current.Request["fqxb"].FilteHtml();//父亲性别(字典)
            if (!string.IsNullOrEmpty(HttpContext.Current.Request["fqnl"].FilteHtml()))
            {
                fqnl = Convert.ToInt32(HttpContext.Current.Request["fqnl"].FilteHtml());//父亲年龄
            }
            string fqmz = HttpContext.Current.Request["fqmz"].FilteHtml();//父亲民族(字典)
            string fqwhcd = HttpContext.Current.Request["fqwhcd"].FilteHtml();//父亲文化程度(字典)
            string fqsfzh = HttpContext.Current.Request["fqsfzh"].FilteHtml();//父亲身份证号码
            string fqjkzk = HttpContext.Current.Request["fqjkzk"].FilteHtml();//父亲健康状况
            string fqhyzk = HttpContext.Current.Request["fqhyzk"].FilteHtml();//父亲婚姻状况(字典)
            string fqzy = HttpContext.Current.Request["fqzy"].FilteHtml();//父亲职业
            string fqgzdw = HttpContext.Current.Request["fqgzdw"].FilteHtml();//父亲工作单位
            string fqlxdh = HttpContext.Current.Request["fqlxdh"].FilteHtml();//父亲联系电话
            string fqjtzz = HttpContext.Current.Request["fqjtzz"].FilteHtml();//父亲家庭住址
            string mqxm = HttpContext.Current.Request["mqxm"].FilteHtml();//母亲姓名
            string mqxb = HttpContext.Current.Request["mqxb"].FilteHtml();//母亲性别(字典)
            if (!string.IsNullOrEmpty(HttpContext.Current.Request["mqnl"].FilteHtml()))
            {
                mqnl = Convert.ToInt32(HttpContext.Current.Request["mqnl"].FilteHtml());//母亲年龄
            }
            string mqmz = HttpContext.Current.Request["mqmz"].FilteHtml();//母亲民族(字典)
            string mqwhcd = HttpContext.Current.Request["mqwhcd"].FilteHtml();//母亲文化程度(字典)
            string mqsfzh = HttpContext.Current.Request["mqsfzh"].FilteHtml();//母亲身份证号码
            string mqjkzk = HttpContext.Current.Request["mqjkzk"].FilteHtml();//母亲健康状况
            string mqhyzk = HttpContext.Current.Request["mqhyzk"].FilteHtml();//母亲婚姻状况
            string mqzy = HttpContext.Current.Request["mqzy"].FilteHtml();//母亲职业
            string mqgzdw = HttpContext.Current.Request["mqgzdw"].FilteHtml();//母亲工作单位
            string mqlxdh = HttpContext.Current.Request["mqlxdh"].FilteHtml();//母亲联系电话
            string mqjtzz = HttpContext.Current.Request["mqjtzz"].FilteHtml();//母亲家庭住址
            if (!string.IsNullOrEmpty(HttpContext.Current.Request["jtnsr"].FilteHtml()))
            {
                jtnsr = Convert.ToInt32(HttpContext.Current.Request["jtnsr"].FilteHtml());//家庭年收入
            }
            if (!string.IsNullOrEmpty(HttpContext.Current.Request["nl"].FilteHtml()))
            {
                xyznqk = Convert.ToInt32(HttpContext.Current.Request["xyznqk"].FilteHtml());//现有子女情况
            }
            string xm = HttpContext.Current.Request["xm"].FilteHtml();//姓名
            string xb = HttpContext.Current.Request["xb"].FilteHtml();//性别(字典)
            if (!string.IsNullOrEmpty(HttpContext.Current.Request["nl"].FilteHtml()))
            {
                nl = Convert.ToInt32(HttpContext.Current.Request["nl"].FilteHtml());//年龄
            }

            string mz = HttpContext.Current.Request["mz"].FilteHtml();//民族(字典)
            string jkzk = HttpContext.Current.Request["jkzk"].FilteHtml();//健康状况
            string sfzh = HttpContext.Current.Request["sfzh"].FilteHtml();//身份证号
            string xhkszd = HttpContext.Current.Request["xhkszd"].FilteHtml();//现户口所在地
            string syzbldw = HttpContext.Current.Request["syzbldw"].FilteHtml();//收养证办理单位
            string sljg = HttpContext.Current.Request["sljg"].FilteHtml();//受理机关(字典)
            string bz = HttpContext.Current.Request["bz"].FilteHtml();//备注
            AjaxResultModel mResultModel = new AjaxResultModel(); //初始化返回类型
            MsjHzSyznlh msjhzsyznlh = new MsjHzSyznlh();
            try
            {
                msjhzsyznlh.Syid = Guid.NewGuid().ToString(); //主键
                msjhzsyznlh.Fqxm = fqxm;//父亲姓名
                msjhzsyznlh.Fqxb = fqxb;//父亲性别(字典)
                msjhzsyznlh.Fqnl = fqnl;//父亲年龄
                msjhzsyznlh.Fqmz = fqmz;//父亲民族(字典)
                msjhzsyznlh.Fqwhcd = fqwhcd;//父亲文化程度(字典)
                msjhzsyznlh.Fqsfzh = fqsfzh;//父亲身份证号码
                msjhzsyznlh.Fqjkzk = fqjkzk;//父亲健康状况
                msjhzsyznlh.Fqhyzk = fqhyzk;//父亲婚姻状况(字典)
                msjhzsyznlh.Fqzy = fqzy;//父亲职业
                msjhzsyznlh.Fqgzdw = fqgzdw;//父亲工作单位
                msjhzsyznlh.Fqlxdh = fqlxdh;//父亲联系电话
                msjhzsyznlh.Fqjtzz = fqjtzz;//父亲家庭住址
                msjhzsyznlh.Mqxm = mqxm;//母亲姓名
                msjhzsyznlh.Mqxb = mqxb;//母亲性别(字典)
                msjhzsyznlh.Mqnl = mqnl;//母亲年龄
                msjhzsyznlh.Mqmz = mqmz;//母亲民族(字典)
                msjhzsyznlh.Mqwhcd = mqwhcd;//母亲文化程度(字典)
                msjhzsyznlh.Mqsfzh = mqsfzh;//母亲身份证号码
                msjhzsyznlh.Mqjkzk = mqjkzk;//母亲健康状况
                msjhzsyznlh.Mqhyzk = mqhyzk;//母亲婚姻状况
                msjhzsyznlh.Mqzy = mqzy;//母亲职业
                msjhzsyznlh.Mqgzdw = mqgzdw;//母亲工作单位
                msjhzsyznlh.Mqlxdh = mqlxdh;//母亲联系电话
                msjhzsyznlh.Mqjtzz = mqjtzz;//母亲家庭住址
                msjhzsyznlh.Jtnsr = jtnsr;//家庭年收入
                msjhzsyznlh.Xyznqk = xyznqk;//现有子女情况
                msjhzsyznlh.Xm = xm;//姓名
                msjhzsyznlh.Xb = xb;//性别(字典)
                msjhzsyznlh.Nl = nl;//年龄
                msjhzsyznlh.Mz = mz;//民族(字典)
                msjhzsyznlh.Jkzk = jkzk;//健康状况
                msjhzsyznlh.Sfzh = sfzh;//身份证号
                msjhzsyznlh.Xhkszd = xhkszd;//现户口所在地
                msjhzsyznlh.Syzbldw = syzbldw;//收养证办理单位
                msjhzsyznlh.Sljg = sljg;//受理机关(字典)
                msjhzsyznlh.Bz = bz;//备注
                msjhzsyznlh.Cjsj = DateTime.Now.ToString();////信息添加时间
                msjhzsyznlh.Movesign = "0";////是否传输
                msjhzsyznlh.Enabled = "1";////是否有效

                filedkey = Db.TransInsert<MsjHzSyznlh>(msjhzsyznlh);
                mResultModel.result = "ok";
                mResultModel.data = msjhzsyznlh;
            }
            catch (Exception ex)
            {
                MSEx.DealErr(ex, "实体类的插入操作" + ex.Message.ToString());
                mResultModel.result = "error";
            }
            IsoDateTimeConverter dtConverter = new IsoDateTimeConverter { DateTimeFormat = "yyyy-MM-dd HH:mm:ss" };
            HttpContext.Current.Response.ContentEncoding = System.Text.Encoding.GetEncoding("GB2312");
            var result = JsonUtils.ConvertJsonString(JsonConvert.SerializeObject(mResultModel, dtConverter));
            HttpContext.Current.Response.Write(callback + "(" + result + ")");
            HttpContext.Current.Response.End();
        }
        #endregion

        #region 户口迁移--关联1个表 完成
        /// <summary>
        ///  户口迁移
        /// </summary>
        [WebMethod]
        public void AddMsjHzHkqy()
        {
            object filedkey1, filedkey2;
            int sqrnl = 0;
            string callback = HttpContext.Current.Request["para"];
            string people = HttpContext.Current.Request["people"];//随迁人员表
            string sqrxm = HttpContext.Current.Request["sqrxm"].FilteHtml();//申请人姓名
            string sqrxb = HttpContext.Current.Request["sqrxb"].FilteHtml();//申请人性别(字典)
            if (!string.IsNullOrEmpty(HttpContext.Current.Request["sqrnl"].FilteHtml()))
            {
                sqrnl = Convert.ToInt32(HttpContext.Current.Request["sqrnl"].FilteHtml());//申请人年龄
            }
            string sqrmz = HttpContext.Current.Request["sqrmz"].FilteHtml();//申请人民族(字典)
            string sqrwhcd = HttpContext.Current.Request["sqrwhcd"].FilteHtml();//申请人文化程度(字典)
            string sqrsfzh = HttpContext.Current.Request["sqrsfzh"].FilteHtml();//申请人身份证号
            string sqrdw = HttpContext.Current.Request["sqrdw"].FilteHtml();//申请人单位
            string sqrlxdh = HttpContext.Current.Request["sqrlxdh"].FilteHtml();//申请人联系电话
            string hkszd = HttpContext.Current.Request["hkszd"].FilteHtml();//户口所在地
            string sqqrd = HttpContext.Current.Request["sqqrd"].FilteHtml();//申请迁入地
            string qrly = HttpContext.Current.Request["qrly"].FilteHtml();//迁入理由
            string sljg = HttpContext.Current.Request["sljg"].FilteHtml();//受理机关(字典)
            AjaxResultModel mResultModel = new AjaxResultModel(); //初始化返回类型
            MsjHzHkqy msjhzhkqy = new MsjHzHkqy();
            try
            {
                msjhzhkqy.Qyid = Guid.NewGuid().ToString(); //主键
                msjhzhkqy.Sqrxm = sqrxm;//申请人姓名
                msjhzhkqy.Sqrxb = sqrxb;//申请人性别(字典)
                msjhzhkqy.Sqrnl = sqrnl;//申请人年龄
                msjhzhkqy.Sqrmz = sqrmz;//申请人民族(字典)
                msjhzhkqy.Sqrwhcd = sqrwhcd;//申请人文化程度(字典)
                msjhzhkqy.Sqrsfzh = sqrsfzh;//申请人身份证号
                msjhzhkqy.Sqrdw = sqrdw;//申请人单位
                msjhzhkqy.Sqrlxdh = sqrlxdh;//申请人联系电话
                msjhzhkqy.Hkszd = hkszd;//户口所在地
                msjhzhkqy.Sqqrd = sqqrd;//申请迁入地
                msjhzhkqy.Qrly = qrly;//迁入理由
                msjhzhkqy.Sljg = sljg;//受理机关(字典)
                msjhzhkqy.Cjsj = DateTime.Now.ToString();////信息添加时间
                msjhzhkqy.Movesign = "0";////是否传输
                msjhzhkqy.Enabled = "1";////是否有效
                filedkey1 = Db.TransInsert<MsjHzHkqy>(msjhzhkqy);
                if (filedkey1 != null)
                {
                    if (!string.IsNullOrEmpty(people))
                    {
                        var list = JsonConvert.DeserializeObject<List<MsjHzHkqySqry>>(people);
                        foreach (var i in list)
                        {
                            if (string.IsNullOrEmpty(i.Sqrxm.FilteHtml()) && string.IsNullOrEmpty(i.Sqrsfzh.FilteHtml()))
                            {
                                mResultModel.result = "ok";
                            }
                            else
                            {
                                MsjHzHkqySqry mMsjHzHkqySqry = new MsjHzHkqySqry();
                                mMsjHzHkqySqry.Sqid = Guid.NewGuid().ToString();//随迁人员表主键
                                mMsjHzHkqySqry.Qyid = msjhzhkqy.Qyid;//随迁人员表外键
                                mMsjHzHkqySqry.Sqrxm = i.Sqrxm.FilteHtml();//随迁人姓名
                                mMsjHzHkqySqry.Sqrxb = i.Sqrxb.FilteHtml();//随迁人性别
                                mMsjHzHkqySqry.Sqrcsrq = i.Sqrcsrq.FilteHtml();//随迁人出生日期
                                mMsjHzHkqySqry.Sqrsfzh = i.Sqrsfzh.FilteHtml();//随迁人身份证号
                                mMsjHzHkqySqry.Ysqrgx = i.Ysqrgx.FilteHtml();//与申请人关系(字典)
                                mMsjHzHkqySqry.Cjsj = DateTime.Now.ToString();
                                mMsjHzHkqySqry.Movesign = "0";
                                mMsjHzHkqySqry.Enabled = "1";
                                filedkey2 = Db.TransInsert<MsjHzHkqySqry>(mMsjHzHkqySqry);
                                mResultModel.result = "ok";
                            }
                        }
                    }
                    mResultModel.result = "ok";
                }
                else
                {
                    mResultModel.result = "error";
                }
            }
            catch (Exception ex)
            {
                MSEx.DealErr(ex, "实体类的插入操作" + ex.Message.ToString());
                mResultModel.result = "error";
            }
            IsoDateTimeConverter dtConverter = new IsoDateTimeConverter { DateTimeFormat = "yyyy-MM-dd HH:mm:ss" };
            HttpContext.Current.Response.ContentEncoding = System.Text.Encoding.GetEncoding("GB2312");
            var result = JsonUtils.ConvertJsonString(JsonConvert.SerializeObject(mResultModel, dtConverter));
            HttpContext.Current.Response.Write(callback + "(" + result + ")");
            HttpContext.Current.Response.End();
        }
        #endregion

        #region 户口项目变更更正
        /// <summary>
        ///  户口项目变更更正
        /// </summary>
        [WebMethod]
        public void AddMsjHzHkzmbggz()
        {
            object filedkey;
            string callback = HttpContext.Current.Request["para"];
            string sqrxm = HttpContext.Current.Request["sqrxm"].FilteHtml();//申请人姓名
            string sqrxb = HttpContext.Current.Request["sqrxb"].FilteHtml();//申请人性别(字典)
            string sqrcsrq = HttpContext.Current.Request["sqrcsrq"].FilteHtml();//申请人出生日期
            string sqrmz = HttpContext.Current.Request["sqrmz"].FilteHtml();//申请人民族(字典)
            string whcd = HttpContext.Current.Request["whcd"].FilteHtml();//文化程度(字典)
            string sqrsfzh = HttpContext.Current.Request["sqrsfzh"].FilteHtml();//申请人身份证号
            string gzdw = HttpContext.Current.Request["gzdw"].FilteHtml();//工作单位
            string lxdh = HttpContext.Current.Request["lxdh"].FilteHtml();//联系电话
            string hkszd = HttpContext.Current.Request["hkszd"].FilteHtml();//户口所在地
            string ydjxm = HttpContext.Current.Request["ydjxm"].FilteHtml();//原登记项目
            string yqbggzhxm = HttpContext.Current.Request["yqbggzhxm"].FilteHtml();//要求变更更正后项目
            string sqbggzly = HttpContext.Current.Request["sqbggzly"].FilteHtml();//申请变更更正理由
            string sljg = HttpContext.Current.Request["sljg"].FilteHtml();//受理机关(字典)
            AjaxResultModel mResultModel = new AjaxResultModel(); //初始化返回类型
            MsjHzHkzmbggz msjhzhkzmbggz = new MsjHzHkzmbggz();
            try
            {
                msjhzhkzmbggz.Sqid = Guid.NewGuid().ToString(); //主键
                msjhzhkzmbggz.Sqrxm = sqrxm;//申请人姓名
                msjhzhkzmbggz.Sqrxb = sqrxb;//申请人性别(字典)
                msjhzhkzmbggz.Sqrcsrq = sqrcsrq;//申请人出生日期
                msjhzhkzmbggz.Sqrmz = sqrmz;//申请人民族(字典)
                msjhzhkzmbggz.Whcd = whcd;//文化程度(字典)
                msjhzhkzmbggz.Sqrsfzh = sqrsfzh;//申请人身份证号
                msjhzhkzmbggz.Gzdw = gzdw;//工作单位
                msjhzhkzmbggz.Lxdh = lxdh;//联系电话
                msjhzhkzmbggz.Hkszd = hkszd;//户口所在地
                msjhzhkzmbggz.Ydjxm = ydjxm;//原登记项目
                msjhzhkzmbggz.Yqbggzhxm = yqbggzhxm;//要求变更更正后项目
                msjhzhkzmbggz.Sqbggzly = sqbggzly;//申请变更更正理由
                msjhzhkzmbggz.Sljg = sljg;//受理机关(字典)
                msjhzhkzmbggz.Cjsj = DateTime.Now.ToString();////信息添加时间
                msjhzhkzmbggz.Movesign = "0";////是否传输
                msjhzhkzmbggz.Enabled = "1";////是否有效

                filedkey = Db.TransInsert<MsjHzHkzmbggz>(msjhzhkzmbggz);
                mResultModel.result = "ok";
                mResultModel.data = msjhzhkzmbggz;
            }
            catch (Exception ex)
            {
                MSEx.DealErr(ex, "实体类的插入操作" + ex.Message.ToString());
                mResultModel.result = "error";
            }
            IsoDateTimeConverter dtConverter = new IsoDateTimeConverter { DateTimeFormat = "yyyy-MM-dd HH:mm:ss" };
            HttpContext.Current.Response.ContentEncoding = System.Text.Encoding.GetEncoding("GB2312");
            var result = JsonUtils.ConvertJsonString(JsonConvert.SerializeObject(mResultModel, dtConverter));
            HttpContext.Current.Response.Write(callback + "(" + result + ")");
            HttpContext.Current.Response.End();
        }
        #endregion

        #region 门号牌申办
        /// <summary>
        ///  门号牌申办
        /// </summary>
        [WebMethod]
        public void AddMsjHzMhpsb()
        {
            object filedkey;
            string callback = HttpContext.Current.Request["para"];
            string dwmc = HttpContext.Current.Request["dwmc"].FilteHtml();//单位名称
            string dz = HttpContext.Current.Request["dz"].FilteHtml();//地址(标准名称)
            string szfjpcs = HttpContext.Current.Request["szfjpcs"].FilteHtml();//所在分局派出所(字典)
            string lxr = HttpContext.Current.Request["lxr"].FilteHtml();//联系人
            string lxfs = HttpContext.Current.Request["lxfs"].FilteHtml();//联系方式
            string tgxgzl = HttpContext.Current.Request["tgxgzl"].FilteHtml();//提供相关资料
            string gajgfkqk = HttpContext.Current.Request["gajgfkqk"].FilteHtml();//公安机关反馈情况
            string bz = HttpContext.Current.Request["bz"].FilteHtml();//备注
            AjaxResultModel mResultModel = new AjaxResultModel(); //初始化返回类型
            MsjHzMhpsb msjhzmhpsb = new MsjHzMhpsb();
            try
            {
                msjhzmhpsb.Sqid = Guid.NewGuid().ToString(); //主键
                msjhzmhpsb.Dwmc = dwmc;//单位名称
                msjhzmhpsb.Dz = dz;//地址(标准名称)
                msjhzmhpsb.Szfjpcs = szfjpcs;//所在分局派出所(字典)
                msjhzmhpsb.Lxr = lxr;//联系人
                msjhzmhpsb.Lxfs = lxfs;//联系方式
                msjhzmhpsb.Tgxgzl = tgxgzl;//提供相关资料
                msjhzmhpsb.Gajgfkqk = gajgfkqk;//公安机关反馈情况
                msjhzmhpsb.Bz = bz;//备注
                msjhzmhpsb.Cjsj = DateTime.Now.ToString();////信息添加时间
                msjhzmhpsb.Movesign = "0";////是否传输
                msjhzmhpsb.Enabled = "1";////是否有效

                filedkey = Db.TransInsert<MsjHzMhpsb>(msjhzmhpsb);
                mResultModel.result = "ok";
                mResultModel.data = msjhzmhpsb;
            }
            catch (Exception ex)
            {
                MSEx.DealErr(ex, "实体类的插入操作" + ex.Message.ToString());
                mResultModel.result = "error";
            }
            IsoDateTimeConverter dtConverter = new IsoDateTimeConverter { DateTimeFormat = "yyyy-MM-dd HH:mm:ss" };
            HttpContext.Current.Response.ContentEncoding = System.Text.Encoding.GetEncoding("GB2312");
            var result = JsonUtils.ConvertJsonString(JsonConvert.SerializeObject(mResultModel, dtConverter));
            HttpContext.Current.Response.Write(callback + "(" + result + ")");
            HttpContext.Current.Response.End();
        }
        #endregion

        #region 干部工人调动落户--关联1个表 完成
        /// <summary>
        ///  干部工人调动落户
        /// </summary>
        [WebMethod]
        public void AddMsjHzGbgrddlh()
        {
            object filedkey1, filedkey2;
            string callback = HttpContext.Current.Request["para"];
            string people = HttpContext.Current.Request["people"];
            string sqrxm = HttpContext.Current.Request["sqrxm"].FilteHtml();//申请人姓名
            string sqrxb = HttpContext.Current.Request["sqrxb"].FilteHtml();//申请人性别(字典)
            string sqrcsrq = HttpContext.Current.Request["sqrcsrq"].FilteHtml();//申请人出生日期
            string sqrmz = HttpContext.Current.Request["sqrmz"].FilteHtml();//申请人民族(民族)
            string sqrsfzh = HttpContext.Current.Request["sqrsfzh"].FilteHtml();//申请人身份证号
            string lxdh = HttpContext.Current.Request["lxdh"].FilteHtml();//联系电话
            string yszdw = HttpContext.Current.Request["yszdw"].FilteHtml();//原所在单位
            string qrdw = HttpContext.Current.Request["qrdw"].FilteHtml();//迁入单位
            string hkszd = HttpContext.Current.Request["hkszd"].FilteHtml();//户口所在地
            string sqqrd = HttpContext.Current.Request["sqqrd"].FilteHtml();//申请迁入地
            string qrly = HttpContext.Current.Request["qrly"].FilteHtml();//迁入理由
            string sljg = HttpContext.Current.Request["sljg"].FilteHtml();//受理机关(字典)
            AjaxResultModel mResultModel = new AjaxResultModel(); //初始化返回类型
            MsjHzGbgrddlh msjhzgbgrddlh = new MsjHzGbgrddlh();
            try
            {
                msjhzgbgrddlh.Ddid = Guid.NewGuid().ToString(); //主键
                msjhzgbgrddlh.Sqrxm = sqrxm;//申请人姓名
                msjhzgbgrddlh.Sqrxb = sqrxb;//申请人性别(字典)
                msjhzgbgrddlh.Sqrcsrq = sqrcsrq;//申请人出生日期
                msjhzgbgrddlh.Sqrmz = sqrmz;//申请人民族(民族)
                msjhzgbgrddlh.Sqrsfzh = sqrsfzh;//申请人身份证号
                msjhzgbgrddlh.Lxdh = lxdh;//联系电话
                msjhzgbgrddlh.Yszdw = yszdw;//原所在单位
                msjhzgbgrddlh.Qrdw = qrdw;//迁入单位
                msjhzgbgrddlh.Hkszd = hkszd;//户口所在地
                msjhzgbgrddlh.Sqqrd = sqqrd;//申请迁入地
                msjhzgbgrddlh.Qrly = qrly;//迁入理由
                msjhzgbgrddlh.Sljg = sljg;//受理机关(字典)
                msjhzgbgrddlh.Cjsj = DateTime.Now.ToString();////信息添加时间
                msjhzgbgrddlh.Movesign = "0";////是否传输
                msjhzgbgrddlh.Enabled = "1";////是否有效 
                filedkey1 = Db.TransInsert<MsjHzGbgrddlh>(msjhzgbgrddlh);
                if (filedkey1 != null)
                {
                    if (!string.IsNullOrEmpty(people))
                    {
                        var list = JsonConvert.DeserializeObject<List<MsjHzGbgrddlhSqry>>(people);
                        foreach (var i in list)
                        {
                            if (string.IsNullOrEmpty(i.Sqrxm.FilteHtml()) && string.IsNullOrEmpty(i.Sqrsfzh.FilteHtml()))
                            {
                                mResultModel.result = "ok";
                            }
                            else
                            {
                                MsjHzGbgrddlhSqry mMsjHzGbgrddlhSqry = new MsjHzGbgrddlhSqry();
                                mMsjHzGbgrddlhSqry.Sqid = Guid.NewGuid().ToString();//随迁人员表主键
                                mMsjHzGbgrddlhSqry.Ddid = msjhzgbgrddlh.Ddid;//随迁人员表外键
                                mMsjHzGbgrddlhSqry.Sqrxm = i.Sqrxm.FilteHtml();//随迁人姓名
                                mMsjHzGbgrddlhSqry.Sqrxb = i.Sqrxb.FilteHtml();//随迁人性别
                                mMsjHzGbgrddlhSqry.Sqrnl = i.Sqrnl.FilteHtml();//随迁人出生日期
                                mMsjHzGbgrddlhSqry.Sqrsfzh = i.Sqrsfzh.FilteHtml();//随迁人身份证号
                                mMsjHzGbgrddlhSqry.Ysqrgx = i.Ysqrgx.FilteHtml();//与申请人关系(字典)
                                mMsjHzGbgrddlhSqry.Cjsj = DateTime.Now.ToString();
                                mMsjHzGbgrddlhSqry.Movesign = "0";
                                mMsjHzGbgrddlhSqry.Enabled = "1";
                                filedkey2 = Db.TransInsert<MsjHzGbgrddlhSqry>(mMsjHzGbgrddlhSqry);
                                mResultModel.result = "ok";
                            }
                        }
                    }
                    mResultModel.result = "ok";
                }
                else
                {
                    mResultModel.result = "error";
                }
            }
            catch (Exception ex)
            {
                MSEx.DealErr(ex, "实体类的插入操作" + ex.Message.ToString());
                mResultModel.result = "error";
            }
            IsoDateTimeConverter dtConverter = new IsoDateTimeConverter { DateTimeFormat = "yyyy-MM-dd HH:mm:ss" };
            HttpContext.Current.Response.ContentEncoding = System.Text.Encoding.GetEncoding("GB2312");
            var result = JsonUtils.ConvertJsonString(JsonConvert.SerializeObject(mResultModel, dtConverter));
            HttpContext.Current.Response.Write(callback + "(" + result + ")");
            HttpContext.Current.Response.End();
        }
        #endregion

        #region 复员、退伍军人落户
        /// <summary>
        ///  复员、退伍军人落户
        /// </summary>
        [WebMethod]
        public void AddMsjHzFytwzyjrlh()
        {
            object filedkey;
            string callback = HttpContext.Current.Request["para"];
            string sqrxm = HttpContext.Current.Request["sqrxm"].FilteHtml();//申请人姓名
            string sqrxb = HttpContext.Current.Request["sqrxb"].FilteHtml();//申请人性别(字典)
            string sqrmz = HttpContext.Current.Request["sqrmz"].FilteHtml();//申请人民族(民族)
            string sqrcsrq = HttpContext.Current.Request["sqrcsrq"].FilteHtml();//申请人出生日期
            string sqrwhcd = HttpContext.Current.Request["sqrwhcd"].FilteHtml();//申请人文化程度(字典)
            string zysj = HttpContext.Current.Request["zysj"].FilteHtml();//转业时间
            string azsj = HttpContext.Current.Request["azsj"].FilteHtml();//安置时间
            string jrgmsfzh = HttpContext.Current.Request["jrgmsfzh"].FilteHtml();//军人公民身份证号
            string yj = HttpContext.Current.Request["yj"].FilteHtml();//原籍
            string gzdw = HttpContext.Current.Request["gzdw"].FilteHtml();//工作单位
            string lxdh = HttpContext.Current.Request["lxdh"].FilteHtml();//联系电话
            string yfydw = HttpContext.Current.Request["yfydw"].FilteHtml();//原服役单位
            string sqqrd = HttpContext.Current.Request["sqqrd"].FilteHtml();//申请迁入地
            string qrly = HttpContext.Current.Request["qrly"].FilteHtml();//迁入理由
            string sljg = HttpContext.Current.Request["sljg"].FilteHtml();//受理机关(字典)
            AjaxResultModel mResultModel = new AjaxResultModel(); //初始化返回类型
            MsjHzFytwzyjrlh msjhzfytwzyjrlh = new MsjHzFytwzyjrlh();
            try
            {
                msjhzfytwzyjrlh.Sqid = Guid.NewGuid().ToString(); //主键
                msjhzfytwzyjrlh.Sqrxm = sqrxm;//申请人姓名
                msjhzfytwzyjrlh.Sqrxb = sqrxb;//申请人性别(字典)
                msjhzfytwzyjrlh.Sqrmz = sqrmz;//申请人民族(民族)
                msjhzfytwzyjrlh.Sqrcsrq = sqrcsrq;//申请人出生日期
                msjhzfytwzyjrlh.Sqrwhcd = sqrwhcd;//申请人文化程度(字典)
                msjhzfytwzyjrlh.Zysj = zysj;//转业时间
                msjhzfytwzyjrlh.Azsj = azsj;//安置时间
                msjhzfytwzyjrlh.Jrgmsfzh = jrgmsfzh;//军人公民身份证号
                msjhzfytwzyjrlh.Yj = yj;//原籍
                msjhzfytwzyjrlh.Gzdw = gzdw;//工作单位
                msjhzfytwzyjrlh.Lxdh = lxdh;//联系电话
                msjhzfytwzyjrlh.Yfydw = yfydw;//原服役单位
                msjhzfytwzyjrlh.Sqqrd = sqqrd;//申请迁入地
                msjhzfytwzyjrlh.Qrly = qrly;//迁入理由
                msjhzfytwzyjrlh.Sljg = sljg;//受理机关(字典)
                msjhzfytwzyjrlh.Cjsj = DateTime.Now.ToString();////信息添加时间
                msjhzfytwzyjrlh.Movesign = "0";////是否传输
                msjhzfytwzyjrlh.Enabled = "1";////是否有效

                filedkey = Db.TransInsert<MsjHzFytwzyjrlh>(msjhzfytwzyjrlh);
                mResultModel.result = "ok";
                mResultModel.data = msjhzfytwzyjrlh;
            }
            catch (Exception ex)
            {
                MSEx.DealErr(ex, "实体类的插入操作" + ex.Message.ToString());
                mResultModel.result = "error";
            }
            IsoDateTimeConverter dtConverter = new IsoDateTimeConverter { DateTimeFormat = "yyyy-MM-dd HH:mm:ss" };
            HttpContext.Current.Response.ContentEncoding = System.Text.Encoding.GetEncoding("GB2312");
            var result = JsonUtils.ConvertJsonString(JsonConvert.SerializeObject(mResultModel, dtConverter));
            HttpContext.Current.Response.Write(callback + "(" + result + ")");
            HttpContext.Current.Response.End();
        }
        #endregion

        #region 户口注销
        /// <summary>
        ///  户口注销
        /// </summary>
        [WebMethod]
        public void AddMsjHzHkzx()
        {
            object filedkey;
            string callback = HttpContext.Current.Request["para"];
            string sqrxm = HttpContext.Current.Request["sqrxm"].FilteHtml();//死亡人姓名
            string xb = HttpContext.Current.Request["xb"].FilteHtml();//性别(字典)
            string csrq = HttpContext.Current.Request["csrq"].FilteHtml();//出生日期
            string mz = HttpContext.Current.Request["mz"].FilteHtml();//民族(字典)
            string sfzh = HttpContext.Current.Request["sfzh"].FilteHtml();//身份证号
            string zxyy = HttpContext.Current.Request["zxyy"].FilteHtml();//注销原因
            string swdd = HttpContext.Current.Request["swdd"].FilteHtml();//死亡地点
            string swsj = HttpContext.Current.Request["swsj"].FilteHtml();//死亡时间
            string hkszd = HttpContext.Current.Request["hkszd"].FilteHtml();//户口所在地
            string dbrxm = HttpContext.Current.Request["dbrxm"].FilteHtml();//代办人姓名
            string dbrsfzh = HttpContext.Current.Request["dbrsfzh"].FilteHtml();//代办人身份证号
            string dbrhkszdhxzz = HttpContext.Current.Request["dbrhkszdhxzz"].FilteHtml();//代办人户口所在地或现住址
            string dbrlxdh = HttpContext.Current.Request["dbrlxdh"].FilteHtml();//代办人联系电话
            string sljg = HttpContext.Current.Request["sljg"].FilteHtml();//受理机关(字典)
            string bz = HttpContext.Current.Request["bz"].FilteHtml();//备注
            AjaxResultModel mResultModel = new AjaxResultModel(); //初始化返回类型
            MsjHzHkzx msjhzhkzx = new MsjHzHkzx();
            try
            {
                msjhzhkzx.Sqid = Guid.NewGuid().ToString(); //主键
                msjhzhkzx.Sqrxm = sqrxm;//死亡人姓名
                msjhzhkzx.Xb = xb;//性别(字典)
                msjhzhkzx.Csrq = csrq;//出生日期
                msjhzhkzx.Mz = mz;//民族(字典)
                msjhzhkzx.Sfzh = sfzh;//身份证号
                msjhzhkzx.Zxyy = zxyy;//注销原因
                msjhzhkzx.Swdd = swdd;//死亡地点
                msjhzhkzx.Swsj = swsj;//死亡时间
                msjhzhkzx.Hkszd = hkszd;//户口所在地
                msjhzhkzx.Dbrxm = dbrxm;//代办人姓名
                msjhzhkzx.Dbrsfzh = dbrsfzh;//代办人身份证号
                msjhzhkzx.Dbrhkszdhxzz = dbrhkszdhxzz;//代办人户口所在地或现住址
                msjhzhkzx.Dbrlxdh = dbrlxdh;//代办人联系电话
                msjhzhkzx.Sljg = sljg;//受理机关(字典)
                msjhzhkzx.Bz = bz;//备注
                msjhzhkzx.Cjsj = DateTime.Now.ToString();////信息添加时间
                msjhzhkzx.Movesign = "0";////是否传输
                msjhzhkzx.Enabled = "1";////是否有效

                filedkey = Db.TransInsert<MsjHzHkzx>(msjhzhkzx);
                mResultModel.result = "ok";
                mResultModel.data = msjhzhkzx;
            }
            catch (Exception ex)
            {
                MSEx.DealErr(ex, "实体类的插入操作" + ex.Message.ToString());
                mResultModel.result = "error";
            }
            IsoDateTimeConverter dtConverter = new IsoDateTimeConverter { DateTimeFormat = "yyyy-MM-dd HH:mm:ss" };
            HttpContext.Current.Response.ContentEncoding = System.Text.Encoding.GetEncoding("GB2312");
            var result = JsonUtils.ConvertJsonString(JsonConvert.SerializeObject(mResultModel, dtConverter));
            HttpContext.Current.Response.Write(callback + "(" + result + ")");
            HttpContext.Current.Response.End();
        }
        #endregion

        #region 楼牌号申办
        /// <summary>
        ///   楼牌号申办
        /// </summary>
        [WebMethod]
        public void AddMsjHzLhpsb()
        {
            object filedkey;
            string callback = HttpContext.Current.Request["para"];
            string kfsmc = HttpContext.Current.Request["kfsmc"].FilteHtml();//开发商名称
            string njxqmc = HttpContext.Current.Request["njxqmc"].FilteHtml();//拟建小区名称
            string njxqdz = HttpContext.Current.Request["njxqdz"].FilteHtml();//拟建小区地址(标准名称)
            string szfjpcs = HttpContext.Current.Request["szfjpcs"].FilteHtml();//所在分局派出所(字典)
            string lxr = HttpContext.Current.Request["lxr"].FilteHtml();//联系人
            string lxfs = HttpContext.Current.Request["lxfs"].FilteHtml();//联系方式
            string tgxgzl = HttpContext.Current.Request["tgxgzl"].FilteHtml();//提供相关资料
            string gajgfkqk = HttpContext.Current.Request["gajgfkqk"].FilteHtml();//公安机关反馈情况
            string bz = HttpContext.Current.Request["bz"].FilteHtml();//备注
            AjaxResultModel mResultModel = new AjaxResultModel(); //初始化返回类型
            MsjHzLhpsb msjhzlhpsb = new MsjHzLhpsb();
            try
            {
                msjhzlhpsb.Sqid = Guid.NewGuid().ToString(); //主键
                msjhzlhpsb.Kfsmc = kfsmc;//开发商名称
                msjhzlhpsb.Njxqmc = njxqmc;//拟建小区名称
                msjhzlhpsb.Njxqdz = njxqdz;//拟建小区地址(标准名称)
                msjhzlhpsb.Szfjpcs = szfjpcs;//所在分局派出所(字典)
                msjhzlhpsb.Lxr = lxr;//联系人
                msjhzlhpsb.Lxfs = lxfs;//联系方式
                msjhzlhpsb.Tgxgzl = tgxgzl;//提供相关资料
                msjhzlhpsb.Gajgfkqk = gajgfkqk;//公安机关反馈情况
                msjhzlhpsb.Bz = bz;//备注
                msjhzlhpsb.Cjsj = DateTime.Now.ToString();////信息添加时间
                msjhzlhpsb.Movesign = "0";////是否传输
                msjhzlhpsb.Enabled = "1";////是否有效

                filedkey = Db.TransInsert<MsjHzLhpsb>(msjhzlhpsb);
                mResultModel.result = "ok";
                mResultModel.data = msjhzlhpsb;
            }
            catch (Exception ex)
            {
                MSEx.DealErr(ex, "实体类的插入操作" + ex.Message.ToString());
                mResultModel.result = "error";
            }
            IsoDateTimeConverter dtConverter = new IsoDateTimeConverter { DateTimeFormat = "yyyy-MM-dd HH:mm:ss" };
            HttpContext.Current.Response.ContentEncoding = System.Text.Encoding.GetEncoding("GB2312");
            var result = JsonUtils.ConvertJsonString(JsonConvert.SerializeObject(mResultModel, dtConverter));
            HttpContext.Current.Response.Write(callback + "(" + result + ")");
            HttpContext.Current.Response.End();
        }
        #endregion
        #endregion

        #region -----治安接口-----2表关联

        #region 娱乐场所备案 前台13表单接口
        /// <summary>
        ///  娱乐场所备案
        /// </summary>
        [WebMethod]
        public void AddMsjZaYlcsba()
        {
            object filedkey;
            string callback = HttpContext.Current.Request["para"];
            string hylb = HttpContext.Current.Request["hylb"].FilteHtml();//行业类别(数据字典)
            string dwbh = HttpContext.Current.Request["dwbh"].FilteHtml();//单位编号
            string dwmc = HttpContext.Current.Request["dwmc"].FilteHtml();//单位(个人)名称
            string dwdz = HttpContext.Current.Request["dwdz"].FilteHtml();//单位地址
            string sjzgbm = HttpContext.Current.Request["sjzgbm"].FilteHtml();//上级主管部门（选择）
            string jyxz = HttpContext.Current.Request["jyxz"].FilteHtml();//经营性质(数据字典)
            string sfzh = HttpContext.Current.Request["sfzh"].FilteHtml();//公民身份证号
            string frxm = HttpContext.Current.Request["frxm"].FilteHtml();//法人（负责人）
            string lxdh = HttpContext.Current.Request["lxdh"].FilteHtml();//联系电话
            string zafzr = HttpContext.Current.Request["zafzr"].FilteHtml();//治安负责人
            string yyzzzchm = HttpContext.Current.Request["yyzzzchm"].FilteHtml();//经营范围-主营
            string gajgdjsj = HttpContext.Current.Request["gajgdjsj"].FilteHtml();//经营范围-兼营
            string gajgjsr = HttpContext.Current.Request["gajgjsr"].FilteHtml();//是否具备许可条件
            string qyjbr = HttpContext.Current.Request["qyjbr"].FilteHtml();//材料是否齐全
            AjaxResultModel mResultModel = new AjaxResultModel(); //初始化返回类型
            MsjZaYlcsba msjzaylcsba = new MsjZaYlcsba();
            try
            {
                msjzaylcsba.Dwid = Guid.NewGuid().ToString(); //主键
                msjzaylcsba.Hylb = hylb;//行业类别(数据字典)
                msjzaylcsba.Dwbh = dwbh;//单位编号
                msjzaylcsba.Dwmc = dwmc;//单位(个人)名称
                msjzaylcsba.Dwdz = dwdz;//单位地址
                msjzaylcsba.Sjzgbm = sjzgbm;//上级主管部门（选择）
                msjzaylcsba.Jyxz = jyxz;//经营性质(数据字典)
                msjzaylcsba.Sfzh = sfzh;//公民身份证号
                msjzaylcsba.Frxm = frxm;//法人（负责人）
                msjzaylcsba.Lxdh = lxdh;//联系电话
                msjzaylcsba.Zafzr = zafzr;//治安负责人
                msjzaylcsba.Yyzzzchm = yyzzzchm;//经营范围-主营
                msjzaylcsba.Gajgdjsj = gajgdjsj;//经营范围-兼营
                msjzaylcsba.Gajgjsr = gajgjsr;//是否具备许可条件
                msjzaylcsba.Qyjbr = qyjbr;//材料是否齐全
                msjzaylcsba.Cjsj = DateTime.Now.ToString();////信息添加时间
                msjzaylcsba.Movesign = "0";////是否传输
                msjzaylcsba.Enabled = "1";////是否有效

                filedkey = Db.TransInsert<MsjZaYlcsba>(msjzaylcsba);
                mResultModel.result = "ok";
                mResultModel.data = msjzaylcsba;
            }
            catch (Exception ex)
            {
                MSEx.DealErr(ex, "实体类的插入操作" + ex.Message.ToString());
                mResultModel.result = "error";
            }
            IsoDateTimeConverter dtConverter = new IsoDateTimeConverter { DateTimeFormat = "yyyy-MM-dd HH:mm:ss" };
            HttpContext.Current.Response.ContentEncoding = System.Text.Encoding.GetEncoding("GB2312");
            var result = JsonUtils.ConvertJsonString(JsonConvert.SerializeObject(mResultModel, dtConverter));
            HttpContext.Current.Response.Write(callback + "(" + result + ")");
            HttpContext.Current.Response.End();
        }
        #endregion

        #region 开锁业备案 1个关联 完成
        /// <summary>
        ///  开锁业备案
        /// </summary>
        [WebMethod]
        public void AddMsjZaKsyba()
        {
            object filedkey1, filedkey2;
            string callback = HttpContext.Current.Request["para"];
            string people = HttpContext.Current.Request["people"].FilteHtml();//从业人员id
            string qybh = HttpContext.Current.Request["qybh"].FilteHtml();//企业编号
            string qymc = HttpContext.Current.Request["qymc"].FilteHtml();//企业名称
            string qydz = HttpContext.Current.Request["qydz"].FilteHtml();//企业地址
            string fddbrid = HttpContext.Current.Request["fddbrid"].FilteHtml();//法定代表人ID
            string gsbmzcsj = HttpContext.Current.Request["gsbmzcsj"].FilteHtml();//工商部门注册时间(2013-01-12)
            string yyzzzchm = HttpContext.Current.Request["yyzzzchm"].FilteHtml();//营业执照注册号码
            string gajgdjsj = HttpContext.Current.Request["gajgdjsj"].FilteHtml();//公安机关登记时间
            string gajgjsr = HttpContext.Current.Request["gajgjsr"].FilteHtml();//公安机关经手人
            string qyjbr = HttpContext.Current.Request["qyjbr"].FilteHtml();//企业经办人
            AjaxResultModel mResultModel = new AjaxResultModel(); //初始化返回类型
            MsjZaKsyba msjzaksyba = new MsjZaKsyba();
            try
            {
                msjzaksyba.Qyid = Guid.NewGuid().ToString(); //主键
                msjzaksyba.Qybh = qybh;//企业编号
                msjzaksyba.Qymc = qymc;//企业名称
                msjzaksyba.Qydz = qydz;//企业地址
                msjzaksyba.Fddbrid = fddbrid;//法定代表人ID
                msjzaksyba.Gsbmzcsj = gsbmzcsj;//工商部门注册时间(2013-01-12)
                msjzaksyba.Yyzzzchm = yyzzzchm;//营业执照注册号码
                msjzaksyba.Gajgdjsj = gajgdjsj;//公安机关登记时间
                msjzaksyba.Gajgjsr = gajgjsr;//公安机关经手人
                msjzaksyba.Qyjbr = qyjbr;//企业经办人
                msjzaksyba.Cjsj = DateTime.Now.ToString();////信息添加时间
                msjzaksyba.Movesign = "0";////是否传输
                msjzaksyba.Enabled = "1";////是否有效

                filedkey1 = Db.TransInsert<MsjZaKsyba>(msjzaksyba);
                if (filedkey1 != null)
                {
                    if (!string.IsNullOrEmpty(people))
                    {
                        var list = JsonConvert.DeserializeObject<List<MsjZaKsybacyry>>(people);
                        foreach (var i in list)
                        {
                            if (string.IsNullOrEmpty(i.Xm.FilteHtml()) && string.IsNullOrEmpty(i.Sfzh.FilteHtml()))
                            {
                                mResultModel.result = "ok";
                            }
                            else
                            {
                                MsjZaKsybacyry mMsjZaKsybacyry = new MsjZaKsybacyry();
                                mMsjZaKsybacyry.Cyryid = Guid.NewGuid().ToString();//人员表主键人员id
                                mMsjZaKsybacyry.Qyid = msjzaksyba.Qyid;//企业id
                                mMsjZaKsybacyry.Lb = i.Lb.FilteHtml();//类别
                                mMsjZaKsybacyry.Xm = i.Xm.FilteHtml();//姓名
                                mMsjZaKsybacyry.Sfzh = i.Sfzh.FilteHtml();//身份证号
                                mMsjZaKsybacyry.Lxdh = i.Lxdh.FilteHtml();//联系电话
                                mMsjZaKsybacyry.Hjd = i.Hjd;//户籍地
                                mMsjZaKsybacyry.Zyzgzsbh = i.Zyzgzsbh;//职业资格证书编号
                                mMsjZaKsybacyry.Pxm = i.Pxm;//顺序码
                                mMsjZaKsybacyry.Cjsj = DateTime.Now.ToString();
                                mMsjZaKsybacyry.Movesign = "0";
                                mMsjZaKsybacyry.Enabled = "1";
                                filedkey2 = Db.TransInsert<MsjZaKsybacyry>(mMsjZaKsybacyry);
                                mResultModel.result = "ok";
                            }
                        }
                    }
                    mResultModel.result = "ok";
                }
                else
                {
                    mResultModel.result = "error";
                }
            }
            catch (Exception ex)
            {
                MSEx.DealErr(ex, "实体类的插入操作" + ex.Message.ToString());
                mResultModel.result = "error";
            }
            IsoDateTimeConverter dtConverter = new IsoDateTimeConverter { DateTimeFormat = "yyyy-MM-dd HH:mm:ss" };
            HttpContext.Current.Response.ContentEncoding = System.Text.Encoding.GetEncoding("GB2312");
            var result = JsonUtils.ConvertJsonString(JsonConvert.SerializeObject(mResultModel, dtConverter));
            HttpContext.Current.Response.Write(callback + "(" + result + ")");
            HttpContext.Current.Response.End();
        }
        #endregion

        #region 养犬办证
        /// <summary>
        ///  养犬办证
        /// </summary>
        [WebMethod]
        public void AddMsjZaYqbz()
        {
            object filedkey;
            int jg = 0, tc = 0;
            string callback = HttpContext.Current.Request["para"];
            string xm = HttpContext.Current.Request["xm"].FilteHtml();//养犬人姓名
            string zw = HttpContext.Current.Request["zw"].FilteHtml();//联系电话
            string sfzh = HttpContext.Current.Request["sfzh"].FilteHtml();//身份证号
            string email = HttpContext.Current.Request["email"].FilteHtml();//Email地址
            string yqrzz = HttpContext.Current.Request["yqrzz"].FilteHtml();//养犬人住址(请精确到门牌号码）
            string sjdwid = HttpContext.Current.Request["sjdwid"].FilteHtml();//上级单位ID(所属分局和市局）
            string pcsid = HttpContext.Current.Request["pcsid"].FilteHtml();//单位ID
            string qz = HttpContext.Current.Request["qz"].FilteHtml();//犬种
            string ms = HttpContext.Current.Request["ms"].FilteHtml();//毛色
            if (!string.IsNullOrEmpty(HttpContext.Current.Request["jg"].FilteHtml()))
            {
                jg = Convert.ToInt32(HttpContext.Current.Request["jg"].FilteHtml());//肩高(cm)
            }
            if (!string.IsNullOrEmpty(HttpContext.Current.Request["tc"].FilteHtml()))
            {
                tc = Convert.ToInt32(HttpContext.Current.Request["tc"].FilteHtml());//肩高(cm)
            }
            string xb = HttpContext.Current.Request["xb"].FilteHtml();//犬只性别（1雄，0雌）
            string qm = HttpContext.Current.Request["qm"].FilteHtml();//犬名
            //string zp = HttpContext.Current.Request["zp"].FilteHtml();//犬只照片
            AjaxResultModel mResultModel = new AjaxResultModel(); //初始化返回类型
            MsjZaYqbz msjzayqbz = new MsjZaYqbz();
            try
            {
                msjzayqbz.Ryid = Guid.NewGuid().ToString(); //主键
                msjzayqbz.Xm = xm;//养犬人姓名
                msjzayqbz.Zw = zw;//联系电话
                msjzayqbz.Sfzh = sfzh;//身份证号
                msjzayqbz.Email = email;//Email地址
                msjzayqbz.Yqrzz = yqrzz;//养犬人住址(请精确到门牌号码）
                msjzayqbz.Sjdwid = sjdwid;//上级单位ID(所属分局和市局）
                msjzayqbz.Pcsid = pcsid;//单位ID
                msjzayqbz.Qz = qz;//犬种
                msjzayqbz.Ms = ms;//毛色
                msjzayqbz.Jg = jg;//肩高(cm)
                msjzayqbz.Tc = tc;//体长(cm)
                msjzayqbz.Xb = xb;//犬只性别（1雄，0雌）
                msjzayqbz.Qm = qm;//犬名
                //msjzayqbz.Zp = zp;//犬只照片
                msjzayqbz.Cjsj = DateTime.Now.ToString();////信息添加时间
                msjzayqbz.Movesign = "0";////是否传输
                msjzayqbz.Enabled = "1";////是否有效

                filedkey = Db.TransInsert<MsjZaYqbz>(msjzayqbz);
                mResultModel.result = "ok";
                mResultModel.data = msjzayqbz;
            }
            catch (Exception ex)
            {
                MSEx.DealErr(ex, "实体类的插入操作" + ex.Message.ToString());
                mResultModel.result = "error";
            }
            IsoDateTimeConverter dtConverter = new IsoDateTimeConverter { DateTimeFormat = "yyyy-MM-dd HH:mm:ss" };
            HttpContext.Current.Response.ContentEncoding = System.Text.Encoding.GetEncoding("GB2312");
            var result = JsonUtils.ConvertJsonString(JsonConvert.SerializeObject(mResultModel, dtConverter));
            HttpContext.Current.Response.Write(callback + "(" + result + ")");
            HttpContext.Current.Response.End();
        }
        #endregion

        #region 剧毒化学品购买凭证核发
        /// <summary>
        ///  剧毒化学品购买凭证核发
        /// </summary>
        [WebMethod]
        public void AddMsjZaJdhxpgmpz()
        {
            object filedkey;
            string callback = HttpContext.Current.Request["para"];
            string qymc = HttpContext.Current.Request["qymc"].FilteHtml();//购买单位名称
            string qydz = HttpContext.Current.Request["qydz"].FilteHtml();//单位法人
            string dz = HttpContext.Current.Request["dz"].FilteHtml();//单位地址
            string lxdh = HttpContext.Current.Request["lxdh"].FilteHtml();//单位电话
            string jbrxm = HttpContext.Current.Request["jbrxm"].FilteHtml();//经办人姓名
            string sfzh = HttpContext.Current.Request["sfzh"].FilteHtml();//身份证件号码
            string bwfzr = HttpContext.Current.Request["bwfzr"].FilteHtml();//保卫负责人
            string bgry = HttpContext.Current.Request["bgry"].FilteHtml();//保管人员
            string cctj = HttpContext.Current.Request["cctj"].FilteHtml();//储存条件
            string jdhxpyt = HttpContext.Current.Request["jdhxpyt"].FilteHtml();//剧毒化学品用途
            string gmdwfzrshyj = HttpContext.Current.Request["gmdwfzrshyj"].FilteHtml();//购买单位_负责人审核意见
            string gmdwqm = HttpContext.Current.Request["gmdwqm"].FilteHtml();//购买单位_签名
            string gmdwshsj = HttpContext.Current.Request["gmdwshsj"].FilteHtml();//购买单位_审核时间(2013-01-12)
            string gajgzabmshyj = HttpContext.Current.Request["gajgzabmshyj"].FilteHtml();//公安机关治安部门_审核意见
            string gajgzabmqm = HttpContext.Current.Request["gajgzabmqm"].FilteHtml();//公安机关治安部门_签名
            string gajgzabmshsj = HttpContext.Current.Request["gajgzabmshsj"].FilteHtml();//公安机关治安部门_审核时间(2013-01-12)
            string gajgfzrshyj = HttpContext.Current.Request["gajgfzrshyj"].FilteHtml();//公安机关负责人_审核意见
            string gajgfzrqm = HttpContext.Current.Request["gajgfzrqm"].FilteHtml();//公安机关负责人_签名
            string gajgfzrshsj = HttpContext.Current.Request["gajgfzrshsj"].FilteHtml();//公安机关负责人_审核时间(2013-01-12)
            string bz = HttpContext.Current.Request["bz"].FilteHtml();//备注
            AjaxResultModel mResultModel = new AjaxResultModel(); //初始化返回类型
            MsjZaJdhxpgmpz msjzajdhxpgmpz = new MsjZaJdhxpgmpz();
            try
            {
                msjzajdhxpgmpz.Gmid = Guid.NewGuid().ToString(); //主键
                msjzajdhxpgmpz.Qymc = qymc;//购买单位名称
                msjzajdhxpgmpz.Qydz = qydz;//单位法人
                msjzajdhxpgmpz.Dz = dz;//单位地址
                msjzajdhxpgmpz.Lxdh = lxdh;//单位电话
                msjzajdhxpgmpz.Jbrxm = jbrxm;//经办人姓名
                msjzajdhxpgmpz.Sfzh = sfzh;//身份证件号码
                msjzajdhxpgmpz.Bwfzr = bwfzr;//保卫负责人
                msjzajdhxpgmpz.Bgry = bgry;//保管人员
                msjzajdhxpgmpz.Cctj = cctj;//储存条件
                msjzajdhxpgmpz.Jdhxpyt = jdhxpyt;//剧毒化学品用途
                msjzajdhxpgmpz.GmdwFzrshyj = gmdwfzrshyj;//购买单位_负责人审核意见
                msjzajdhxpgmpz.GmdwQm = gmdwqm;//购买单位_签名
                msjzajdhxpgmpz.GmdwShsj = gmdwshsj;//购买单位_审核时间(2013-01-12)
                msjzajdhxpgmpz.GajgzabmShyj = gajgzabmshyj;//公安机关治安部门_审核意见
                msjzajdhxpgmpz.GajgzabmQm = gajgzabmqm;//公安机关治安部门_签名
                msjzajdhxpgmpz.GajgzabmShsj = gajgzabmshsj;//公安机关治安部门_审核时间(2013-01-12)
                msjzajdhxpgmpz.GajgfzrShyj = gajgfzrshyj;//公安机关负责人_审核意见
                msjzajdhxpgmpz.GajgfzrQm = gajgfzrqm;//公安机关负责人_签名
                msjzajdhxpgmpz.GajgfzrShsj = gajgfzrshsj;//公安机关负责人_审核时间(2013-01-12)
                msjzajdhxpgmpz.Bz = bz;//备注
                msjzajdhxpgmpz.Cjsj = DateTime.Now.ToString();////信息添加时间
                msjzajdhxpgmpz.Movesign = "0";////是否传输
                msjzajdhxpgmpz.Enabled = "1";////是否有效

                filedkey = Db.TransInsert<MsjZaJdhxpgmpz>(msjzajdhxpgmpz);
                mResultModel.result = "ok";
                mResultModel.data = msjzajdhxpgmpz;
            }
            catch (Exception ex)
            {
                MSEx.DealErr(ex, "实体类的插入操作" + ex.Message.ToString());
                mResultModel.result = "error";
            }
            IsoDateTimeConverter dtConverter = new IsoDateTimeConverter { DateTimeFormat = "yyyy-MM-dd HH:mm:ss" };
            HttpContext.Current.Response.ContentEncoding = System.Text.Encoding.GetEncoding("GB2312");
            var result = JsonUtils.ConvertJsonString(JsonConvert.SerializeObject(mResultModel, dtConverter));
            HttpContext.Current.Response.Write(callback + "(" + result + ")");
            HttpContext.Current.Response.End();
        }
        #endregion

        #region 安全技术防范产品生产
        /// <summary>
        ///  安全技术防范产品生产
        /// </summary>
        [WebMethod]
        public void AddMsjZaAqjsffcpsc()
        {
            object filedkey;
            int cpsl = 0;
            string callback = HttpContext.Current.Request["para"];
            string dwmc = HttpContext.Current.Request["dwmc"].FilteHtml();//单位名称
            string frdb = HttpContext.Current.Request["frdb"].FilteHtml();//法人代表
            string dz = HttpContext.Current.Request["dz"].FilteHtml();//地址
            string jjxz = HttpContext.Current.Request["jjxz"].FilteHtml();//经济性质
            string dh = HttpContext.Current.Request["dh"].FilteHtml();//电话
            string cz = HttpContext.Current.Request["cz"].FilteHtml();//传真
            string yzbm = HttpContext.Current.Request["yzbm"].FilteHtml();//邮政编码
            string cpmc = HttpContext.Current.Request["cpmc"].FilteHtml();//产品名称
            string xh = HttpContext.Current.Request["xh"].FilteHtml();//型号
            string cpzxbzmc = HttpContext.Current.Request["cpzxbzmc"].FilteHtml();//产品执行标准名称
            string bzbh = HttpContext.Current.Request["bzbh"].FilteHtml();//标准编号
            if (string.IsNullOrEmpty(HttpContext.Current.Request["cpsl"].FilteHtml()))
            {
                cpsl = Convert.ToInt32(HttpContext.Current.Request["cpsl"].FilteHtml());//产品数量
            }

            string cfdd = HttpContext.Current.Request["cfdd"].FilteHtml();//存放地点
            string qysbsj = HttpContext.Current.Request["qysbsj"].FilteHtml();//企业申报时间
            string sdgajgqssj = HttpContext.Current.Request["sdgajgqssj"].FilteHtml();//市地公安机关签收时间
            string sgatsqsj = HttpContext.Current.Request["sgatsqsj"].FilteHtml();//省公安厅签收时间
            string sgatslsj = HttpContext.Current.Request["sgatslsj"].FilteHtml();//省公安厅受理时间
            string cycbdw = HttpContext.Current.Request["cycbdw"].FilteHtml();//抽样承办单位
            string wtjyjgmc = HttpContext.Current.Request["wtjyjgmc"].FilteHtml();//委托检验机构名称
            string bz = HttpContext.Current.Request["bz"].FilteHtml();//备注
            AjaxResultModel mResultModel = new AjaxResultModel(); //初始化返回类型
            MsjZaAqjsffcpsc msjzaaqjsffcpsc = new MsjZaAqjsffcpsc();
            try
            {
                msjzaaqjsffcpsc.Jyid = Guid.NewGuid().ToString(); //主键
                msjzaaqjsffcpsc.Dwmc = dwmc;//单位名称
                msjzaaqjsffcpsc.Frdb = frdb;//法人代表
                msjzaaqjsffcpsc.Dz = dz;//地址
                msjzaaqjsffcpsc.Jjxz = jjxz;//经济性质
                msjzaaqjsffcpsc.Dh = dh;//电话
                msjzaaqjsffcpsc.Cz = cz;//传真
                msjzaaqjsffcpsc.Yzbm = yzbm;//邮政编码
                msjzaaqjsffcpsc.Cpmc = cpmc;//产品名称
                msjzaaqjsffcpsc.Xh = xh;//型号
                msjzaaqjsffcpsc.Cpzxbzmc = cpzxbzmc;//产品执行标准名称
                msjzaaqjsffcpsc.Bzbh = bzbh;//标准编号
                msjzaaqjsffcpsc.Cpsl = cpsl;//产品数量
                msjzaaqjsffcpsc.Cfdd = cfdd;//存放地点
                msjzaaqjsffcpsc.Qysbsj = qysbsj;//企业申报时间
                msjzaaqjsffcpsc.Sdgajgqssj = sdgajgqssj;//市地公安机关签收时间
                msjzaaqjsffcpsc.Sgatsqsj = sgatsqsj;//省公安厅签收时间
                msjzaaqjsffcpsc.Sgatslsj = sgatslsj;//省公安厅受理时间
                msjzaaqjsffcpsc.Cycbdw = cycbdw;//抽样承办单位
                msjzaaqjsffcpsc.Wtjyjgmc = wtjyjgmc;//委托检验机构名称
                msjzaaqjsffcpsc.Bz = bz;//备注
                msjzaaqjsffcpsc.Cjsj = DateTime.Now.ToString();////信息添加时间
                msjzaaqjsffcpsc.Movesign = "0";////是否传输
                msjzaaqjsffcpsc.Enabled = "1";////是否有效

                filedkey = Db.TransInsert<MsjZaAqjsffcpsc>(msjzaaqjsffcpsc);
                mResultModel.result = "ok";
                mResultModel.data = msjzaaqjsffcpsc;
            }
            catch (Exception ex)
            {
                MSEx.DealErr(ex, "实体类的插入操作" + ex.Message.ToString());
                mResultModel.result = "error";
            }
            IsoDateTimeConverter dtConverter = new IsoDateTimeConverter { DateTimeFormat = "yyyy-MM-dd HH:mm:ss" };
            HttpContext.Current.Response.ContentEncoding = System.Text.Encoding.GetEncoding("GB2312");
            var result = JsonUtils.ConvertJsonString(JsonConvert.SerializeObject(mResultModel, dtConverter));
            HttpContext.Current.Response.Write(callback + "(" + result + ")");
            HttpContext.Current.Response.End();
        }
        #endregion

        #region 安全技术防范工程审核--1个表关联，完成
        /// <summary>
        ///  安全技术防范工程审核
        /// </summary>
        [WebMethod]
        public void AddMsjZaAqjsffgcsjfa()
        {
            object filedkey1, filedkey2;
            int ysje = 0;
            string callback = HttpContext.Current.Request["para"];
            string people = HttpContext.Current.Request["people"];//传来的数组
            string dwmc = HttpContext.Current.Request["dwmc"].FilteHtml();//工程名称
            string dz = HttpContext.Current.Request["dz"].FilteHtml();//地址
            string fxdj = HttpContext.Current.Request["fxdj"].FilteHtml();//风险等级
            if (!string.IsNullOrEmpty(HttpContext.Current.Request["ysje"].FilteHtml()))
            {
                ysje = Convert.ToInt32(HttpContext.Current.Request["ysje"].FilteHtml());//预算金额（万元）
            }
            string jsdwmc = HttpContext.Current.Request["jsdwmc"].FilteHtml();//建设单位_名称
            string jsdwxmfzr = HttpContext.Current.Request["jsdwxmfzr"].FilteHtml();//建设单位_项目负责人
            string jsdwdz = HttpContext.Current.Request["jsdwdz"].FilteHtml();//建设单位_地址
            string jsdwlxdh = HttpContext.Current.Request["jsdwlxdh"].FilteHtml();//建设单位_联系电话
            string jsdwshsj = HttpContext.Current.Request["jsdwshsj"].FilteHtml();//建设单位_审核时间
            string jsdwshyj = HttpContext.Current.Request["jsdwshyj"].FilteHtml();//建设单位_审核意见
            string sgdwmc = HttpContext.Current.Request["sgdwmc"].FilteHtml();//施工单位_名称
            string sgdwxmfzr = HttpContext.Current.Request["sgdwxmfzr"].FilteHtml();//施工单位_项目负责人
            string sgdwdz = HttpContext.Current.Request["sgdwdz"].FilteHtml();//施工单位_地址
            string sgdwlxdh = HttpContext.Current.Request["sgdwlxdh"].FilteHtml();//施工单位_联系电话
            string gajgspyj = HttpContext.Current.Request["gajgspyj"].FilteHtml();//公安机关_审批意见
            string gajgshsj = HttpContext.Current.Request["gajgshsj"].FilteHtml();//公安机关_审核时间
            AjaxResultModel mResultModel = new AjaxResultModel(); //初始化返回类型
            MsjZaAqjsffgcsjfa msjzaaqjsffgcsjfa = new MsjZaAqjsffgcsjfa();
            try
            {
                msjzaaqjsffgcsjfa.Gcid = Guid.NewGuid().ToString(); //主键
                msjzaaqjsffgcsjfa.Dwmc = dwmc;//工程名称
                msjzaaqjsffgcsjfa.Dz = dz;//地址
                msjzaaqjsffgcsjfa.Fxdj = fxdj;//风险等级
                msjzaaqjsffgcsjfa.Ysje = ysje;//预算金额（万元）
                msjzaaqjsffgcsjfa.JsdwMc = jsdwmc;//建设单位_名称
                msjzaaqjsffgcsjfa.JsdwXmfzr = jsdwxmfzr;//建设单位_项目负责人
                msjzaaqjsffgcsjfa.JsdwDz = jsdwdz;//建设单位_地址
                msjzaaqjsffgcsjfa.JsdwLxdh = jsdwlxdh;//建设单位_联系电话
                msjzaaqjsffgcsjfa.JsdwShsj = jsdwshsj;//建设单位_审核时间
                msjzaaqjsffgcsjfa.JsdwShyj = jsdwshyj;//建设单位_审核意见
                msjzaaqjsffgcsjfa.SgdwMc = sgdwmc;//施工单位_名称
                msjzaaqjsffgcsjfa.SgdwXmfzr = sgdwxmfzr;//施工单位_项目负责人
                msjzaaqjsffgcsjfa.SgdwDz = sgdwdz;//施工单位_地址
                msjzaaqjsffgcsjfa.SgdwLxdh = sgdwlxdh;//施工单位_联系电话
                msjzaaqjsffgcsjfa.GajgSpyj = gajgspyj;//公安机关_审批意见
                msjzaaqjsffgcsjfa.GajgShsj = gajgshsj;//公安机关_审核时间
                msjzaaqjsffgcsjfa.Cjsj = DateTime.Now.ToString();////信息添加时间
                msjzaaqjsffgcsjfa.Movesign = "0";////是否传输
                msjzaaqjsffgcsjfa.Enabled = "1";////是否有效
                filedkey1 = Db.TransInsert<MsjZaAqjsffgcsjfa>(msjzaaqjsffgcsjfa);
                if (filedkey1 != null)
                {
                    if (!string.IsNullOrEmpty(people))
                    {
                        var list = JsonConvert.DeserializeObject<List<MsjZaAqjsffgcZysjry>>(people);
                        foreach (var i in list)
                        {
                            if (string.IsNullOrEmpty(i.Xm.FilteHtml()) && string.IsNullOrEmpty(i.Sfzh.FilteHtml()))
                            {
                                mResultModel.result = "ok";
                            }
                            else
                            {
                                MsjZaAqjsffgcZysjry mMsjZaAqjsffgcZysjry = new MsjZaAqjsffgcZysjry();
                                mMsjZaAqjsffgcZysjry.Ryid = Guid.NewGuid().ToString();//人员表主键人员id
                                mMsjZaAqjsffgcZysjry.Gcid = msjzaaqjsffgcsjfa.Gcid;//工程id
                                mMsjZaAqjsffgcZysjry.Xm = i.Xm.FilteHtml();//
                                mMsjZaAqjsffgcZysjry.Zw = i.Zw.FilteHtml();//随迁人性别
                                mMsjZaAqjsffgcZysjry.Jszc = i.Jszc.FilteHtml();//随迁人出生日期
                                mMsjZaAqjsffgcZysjry.Sfzh = i.Sfzh.FilteHtml();//随迁人身份证号
                                mMsjZaAqjsffgcZysjry.Pxm = i.Pxm;//与申请人关系(字典)
                                mMsjZaAqjsffgcZysjry.Cjsj = DateTime.Now.ToString();
                                mMsjZaAqjsffgcZysjry.Movesign = "0";
                                mMsjZaAqjsffgcZysjry.Enabled = "1";
                                filedkey2 = Db.TransInsert<MsjZaAqjsffgcZysjry>(mMsjZaAqjsffgcZysjry);
                                mResultModel.result = "ok";
                            }
                        }
                    }
                    mResultModel.result = "ok";
                }
                else
                {
                    mResultModel.result = "error";
                }
            }
            catch (Exception ex)
            {
                MSEx.DealErr(ex, "实体类的插入操作" + ex.Message.ToString());
                mResultModel.result = "error";
            }
            IsoDateTimeConverter dtConverter = new IsoDateTimeConverter { DateTimeFormat = "yyyy-MM-dd HH:mm:ss" };
            HttpContext.Current.Response.ContentEncoding = System.Text.Encoding.GetEncoding("GB2312");
            var result = JsonUtils.ConvertJsonString(JsonConvert.SerializeObject(mResultModel, dtConverter));
            HttpContext.Current.Response.Write(callback + "(" + result + ")");
            HttpContext.Current.Response.End();
        }
        #endregion

        #endregion

        #endregion

        #region 暂时无用的接口
        //#region 诉求直通 意见建议-添加接口

        ///// <summary>
        ///// 诉求直通 意见建议
        ///// </summary>
        //[WebMethod]
        //public void AddAdvise()
        //{
        //    object filedkey;
        //    string callback = HttpContext.Current.Request["para"];
        //    string name = DES.Encode(HttpContext.Current.Request["name"].FilteHtml());////姓名
        //    string phone = DES.Encode(HttpContext.Current.Request["phone"].FilteHtml());////手机号
        //    string psd = HttpContext.Current.Request["psd"].FilteHtml();////查询密码
        //    string email = DES.Encode(HttpContext.Current.Request["email"].FilteHtml());////邮箱
        //    string address = DES.Encode(HttpContext.Current.Request["address"].FilteHtml());////地址
        //    string content = HttpContext.Current.Request["content"].FilteHtml();////内容
        //    AjaxResultModel mResultModel = new AjaxResultModel(); //初始化返回类型
        //    TbBstAdvise mTbBstAdvise = new TbBstAdvise();
        //    try
        //    {
        //        mTbBstAdvise.Id = Guid.NewGuid().ToString(); //主键
        //        mTbBstAdvise.Name = name; ////本人姓名
        //        mTbBstAdvise.Phone = phone; ////手机号
        //        mTbBstAdvise.Email = email; ////邮箱
        //        mTbBstAdvise.Address = address; ////地址
        //        mTbBstAdvise.Content = content; ////内容
        //        mTbBstAdvise.Psd = psd;
        //        mTbBstAdvise.Createdate = DateTime.Now;//信息添加时间
        //        mTbBstAdvise.Deltag = 0; //删除标志0未删除1已删除
        //        mTbBstAdvise.Movesign = "2";
        //        filedkey = Db.TransInsert<TbBstAdvise>(mTbBstAdvise);
        //        mResultModel.result = "ok";
        //        mResultModel.data = mTbBstAdvise;
        //    }
        //    catch (Exception ex)
        //    {
        //        MSEx.DealErr(ex, "实体类的插入操作");
        //        mResultModel.result = "error";
        //    }
        //    IsoDateTimeConverter dtConverter = new IsoDateTimeConverter { DateTimeFormat = "yyyy-MM-dd HH:mm:ss" };
        //    HttpContext.Current.Response.ContentEncoding = System.Text.Encoding.GetEncoding("GB2312");
        //    var result = JsonUtils.ConvertJsonString(JsonConvert.SerializeObject(mResultModel, dtConverter));
        //    HttpContext.Current.Response.Write(callback + "(" + result + ")");
        //    HttpContext.Current.Response.End();
        //}
        //#endregion

        //#region 诉求直通 意见建议-个人查询
        ///// <summary>
        ///// 诉求直通 意见建议-个人查询
        ///// </summary>
        //[WebMethod]
        //public void GetAdviseList()
        //{
        //    AjaxResultModel mResultModel = new AjaxResultModel(); //初始化返回类型
        //    string callback = HttpContext.Current.Request["para"];
        //    try
        //    {
        //        int pageSize = 20;
        //        int pageIndex = 1;
        //        var replyContent = "";
        //        var replyName = "";
        //        var replyTime = "";
        //        if (!string.IsNullOrEmpty(HttpContext.Current.Request["pageSize"]))
        //        {
        //            pageSize = Convert.ToInt32(HttpContext.Current.Request["pageSize"]);
        //        }
        //        if (pageSize > 30)
        //        {
        //            pageSize = 30;
        //        }
        //        if (!string.IsNullOrEmpty(HttpContext.Current.Request["pageIndex"]))
        //        {
        //            pageIndex = Convert.ToInt32(HttpContext.Current.Request["pageIndex"]);
        //        }
        //        string phone = DES.Encode(HttpContext.Current.Request["phone"].FilteHtml());
        //        string psd = HttpContext.Current.Request["psd"].FilteHtml();
        //        TbBstAdvise mTbBstOnlineAsk = new TbBstAdvise();
        //        DataTable dtTbBstAdvise = new DataTable();
        //        QueryByPage Q = new QueryByPage();
        //        SqlConditionList sqllist = new SqlConditionList();
        //        string sqlWhere = " deltag = 0 ";
        //        if (!string.IsNullOrEmpty(phone)) ////手机号
        //        {
        //            sqllist.AddLogic(new SqlConditionList.SqlCondition(SqlCompareOper.EQUAL, TbBstAdviseConst.Columns.Phone, phone), SqlLogicOper.AND_LOGIC);
        //        }
        //        if (!string.IsNullOrEmpty(psd)) ////密码
        //        {
        //            sqllist.AddLogic(new SqlConditionList.SqlCondition(SqlCompareOper.EQUAL, TbBstAdviseConst.Columns.Psd, psd), SqlLogicOper.AND_LOGIC);
        //        }
        //        if (string.IsNullOrEmpty(sqllist.ToSql()))
        //        {
        //            sqlWhere = "where" + sqlWhere;
        //        }
        //        else
        //        {
        //            sqlWhere = sqllist.ToSql() + " and " + sqlWhere;
        //        }
        //        dtTbBstAdvise = Q.GetRecordByPage("*", sqlWhere, " createdate ", pageSize, pageIndex, TbBstAdviseConst.TableName, TbBstAdviseConst.FieldKey, "desc").Tables[0];
        //        if (dtTbBstAdvise != null && dtTbBstAdvise.Rows.Count > -1)
        //        {
        //            dtTbBstAdvise.Columns.Add(new DataColumn() { ColumnName = "replycontent" });
        //            dtTbBstAdvise.Columns.Add(new DataColumn() { ColumnName = "replyname" });
        //            dtTbBstAdvise.Columns.Add(new DataColumn() { ColumnName = "replytime" });
        //            mResultModel.result = "ok";
        //            mResultModel.totalCount = dtTbBstAdvise.Rows.Count;
        //            ////解密部分加密字段
        //            for (int i = 0; i < dtTbBstAdvise.Rows.Count; i++)
        //            {
        //                dtTbBstAdvise.Rows[i][TbBstAdviseConst.Columns.Phone] = DES.Decode(dtTbBstAdvise.Rows[i][TbBstAdviseConst.Columns.Phone].ToString());
        //                dtTbBstAdvise.Rows[i][TbBstAdviseConst.Columns.Name] = DES.Decode(dtTbBstAdvise.Rows[i][TbBstAdviseConst.Columns.Name].ToString());
        //                dtTbBstAdvise.Rows[i][TbBstAdviseConst.Columns.Email] = DES.Decode(dtTbBstAdvise.Rows[i][TbBstAdviseConst.Columns.Email].ToString());
        //                dtTbBstAdvise.Rows[i][TbBstAdviseConst.Columns.Address] = DES.Decode(dtTbBstAdvise.Rows[i][TbBstAdviseConst.Columns.Address].ToString());
        //                #region 每行加回复内容
        //                string guid = dtTbBstAdvise.Rows[i][TbBstDirectorLetterConst.Columns.Id].ToString();//取id主键
        //                try
        //                {
        //                    DataSet ds = Q.GetRecordByPage("*", "where gdid='" + guid + "'", "", 1, 1, "tb_msjw_sqjg", "ID", "");
        //                    if (ds.Tables[0].Rows.Count > 0)
        //                    {
        //                        replyContent = ds.Tables[0].Rows[0]["ZB_BLJG"].ToString();
        //                        replyName = ds.Tables[0].Rows[0]["ZB_BLRXM"].ToString();
        //                        replyTime = ds.Tables[0].Rows[0]["ZB_BLRQ"].ToString();
        //                        dtTbBstAdvise.Rows[i]["replycontent"] = replyContent;
        //                        dtTbBstAdvise.Rows[i]["replyname"] = replyName;
        //                        dtTbBstAdvise.Rows[i]["replytime"] = replyTime;
        //                    }
        //                }
        //                catch (Exception e)
        //                {

        //                }

        //                #endregion
        //            }
        //            mResultModel.data = dtTbBstAdvise;
        //        }
        //        else
        //        {
        //            mResultModel.result = "error";
        //            mResultModel.ErrorCode = -112;
        //        }
        //    }
        //    catch (Exception e)
        //    {
        //        mResultModel.result = "error";
        //    }
        //    IsoDateTimeConverter dtConverter = new IsoDateTimeConverter { DateTimeFormat = "yyyy-MM-dd HH:mm:ss" };
        //    HttpContext.Current.Response.Charset = "GB2312";
        //    HttpContext.Current.Response.ContentEncoding = System.Text.Encoding.GetEncoding("GB2312");
        //    var result = JsonUtils.ConvertJsonString(JsonConvert.SerializeObject(mResultModel, dtConverter));
        //    HttpContext.Current.Response.Write(callback + "(" + result + ")");
        //    var str = JsonConvert.SerializeObject(mResultModel, dtConverter);
        //    HttpContext.Current.Response.End();
        //}
        //#endregion

        //#region 诉求直通 举报线索-添加接口

        ///// <summary>
        ///// 诉求直通 举报线索
        ///// </summary>
        //[WebMethod]
        //public void AddReportWire()
        //{
        //    object filedkey;
        //    string callback = HttpContext.Current.Request["para"];
        //    string name = DES.Encode(HttpContext.Current.Request["name"].FilteHtml());////姓名
        //    string phone = DES.Encode(HttpContext.Current.Request["phone"].FilteHtml());////手机号
        //    string psd = HttpContext.Current.Request["psd"].FilteHtml();////查询密码
        //    string email = DES.Encode(HttpContext.Current.Request["email"].FilteHtml());////邮箱
        //    string address = DES.Encode(HttpContext.Current.Request["address"].FilteHtml());////地址
        //    string content = HttpContext.Current.Request["content"];////内容
        //    AjaxResultModel mResultModel = new AjaxResultModel(); //初始化返回类型
        //    TbBstReportWire mTbBstReportWire = new TbBstReportWire();
        //    try
        //    {
        //        mTbBstReportWire.Id = Guid.NewGuid().ToString(); //主键
        //        mTbBstReportWire.Name = name; ////本人姓名
        //        mTbBstReportWire.Phone = phone; ////手机号
        //        mTbBstReportWire.Email = email; ////邮箱
        //        mTbBstReportWire.Address = address; ////地址
        //        mTbBstReportWire.Content = content; ////内容
        //        mTbBstReportWire.Psd = psd;
        //        mTbBstReportWire.Createdate = DateTime.Now;//信息添加时间
        //        mTbBstReportWire.Deltag = 0; //删除标志0未删除1已删除
        //        mTbBstReportWire.Movesign = "2";
        //        filedkey = Db.TransInsert<TbBstReportWire>(mTbBstReportWire);
        //        mResultModel.result = "ok";
        //        mResultModel.data = mTbBstReportWire;
        //    }
        //    catch (Exception ex)
        //    {
        //        MSEx.DealErr(ex, "实体类的插入操作");
        //        mResultModel.result = "error";
        //    }
        //    IsoDateTimeConverter dtConverter = new IsoDateTimeConverter { DateTimeFormat = "yyyy-MM-dd HH:mm:ss" };
        //    HttpContext.Current.Response.ContentEncoding = System.Text.Encoding.GetEncoding("GB2312");
        //    var result = JsonUtils.ConvertJsonString(JsonConvert.SerializeObject(mResultModel, dtConverter));
        //    HttpContext.Current.Response.Write(callback + "(" + result + ")");
        //    HttpContext.Current.Response.End();
        //}
        //#endregion

        //#region 诉求直通 举报线索-个人查询
        ///// <summary>
        ///// 诉求直通 举报线索-个人查询
        ///// </summary>
        //[WebMethod]
        //public void GetReportWireList()
        //{
        //    AjaxResultModel mResultModel = new AjaxResultModel(); //初始化返回类型
        //    string callback = HttpContext.Current.Request["para"];
        //    try
        //    {
        //        int pageSize = 20;
        //        int pageIndex = 1;
        //        var replyContent = "";
        //        var replyName = "";
        //        var replyTime = "";
        //        if (!string.IsNullOrEmpty(HttpContext.Current.Request["pageSize"]))
        //        {
        //            pageSize = Convert.ToInt32(HttpContext.Current.Request["pageSize"]);
        //        }
        //        if (pageSize > 30)
        //        {
        //            pageSize = 30;
        //        }
        //        if (!string.IsNullOrEmpty(HttpContext.Current.Request["pageIndex"]))
        //        {
        //            pageIndex = Convert.ToInt32(HttpContext.Current.Request["pageIndex"]);
        //        }
        //        string phone = DES.Encode(HttpContext.Current.Request["phone"].FilteHtml());
        //        string psd = HttpContext.Current.Request["psd"].FilteHtml();
        //        TbBstReportWire mTbBstOnlineAsk = new TbBstReportWire();
        //        DataTable dtTbBstReportWire = new DataTable();
        //        QueryByPage Q = new QueryByPage();
        //        SqlConditionList sqllist = new SqlConditionList();
        //        string sqlWhere = " deltag = 0 ";
        //        if (!string.IsNullOrEmpty(phone)) ////手机号
        //        {
        //            sqllist.AddLogic(new SqlConditionList.SqlCondition(SqlCompareOper.EQUAL, TbBstReportWireConst.Columns.Phone, phone), SqlLogicOper.AND_LOGIC);
        //        }
        //        if (!string.IsNullOrEmpty(psd)) ////密码
        //        {
        //            sqllist.AddLogic(new SqlConditionList.SqlCondition(SqlCompareOper.EQUAL, TbBstReportWireConst.Columns.Psd, psd), SqlLogicOper.AND_LOGIC);
        //        }
        //        if (string.IsNullOrEmpty(sqllist.ToSql()))
        //        {
        //            sqlWhere = "where" + sqlWhere;
        //        }
        //        else
        //        {
        //            sqlWhere = sqllist.ToSql() + " and " + sqlWhere;
        //        }
        //        dtTbBstReportWire = Q.GetRecordByPage("*", sqlWhere, " createdate ", pageSize, pageIndex, TbBstReportWireConst.TableName, TbBstReportWireConst.FieldKey, "desc").Tables[0];
        //        if (dtTbBstReportWire != null && dtTbBstReportWire.Rows.Count > -1)
        //        {
        //            dtTbBstReportWire.Columns.Add(new DataColumn() { ColumnName = "replycontent" });
        //            dtTbBstReportWire.Columns.Add(new DataColumn() { ColumnName = "replyname" });
        //            dtTbBstReportWire.Columns.Add(new DataColumn() { ColumnName = "replytime" });
        //            mResultModel.result = "ok";
        //            mResultModel.totalCount = dtTbBstReportWire.Rows.Count;
        //            ////解密部分加密字段
        //            for (int i = 0; i < dtTbBstReportWire.Rows.Count; i++)
        //            {
        //                dtTbBstReportWire.Rows[i][TbBstReportWireConst.Columns.Phone] = DES.Decode(dtTbBstReportWire.Rows[i][TbBstReportWireConst.Columns.Phone].ToString());
        //                dtTbBstReportWire.Rows[i][TbBstReportWireConst.Columns.Name] = DES.Decode(dtTbBstReportWire.Rows[i][TbBstReportWireConst.Columns.Name].ToString());
        //                dtTbBstReportWire.Rows[i][TbBstReportWireConst.Columns.Email] = DES.Decode(dtTbBstReportWire.Rows[i][TbBstReportWireConst.Columns.Email].ToString());
        //                dtTbBstReportWire.Rows[i][TbBstReportWireConst.Columns.Address] = DES.Decode(dtTbBstReportWire.Rows[i][TbBstReportWireConst.Columns.Address].ToString());
        //                #region 每行加回复内容
        //                string guid = dtTbBstReportWire.Rows[i][TbBstDirectorLetterConst.Columns.Id].ToString();//取id主键
        //                try
        //                {
        //                    DataSet ds = Q.GetRecordByPage("*", "where gdid='" + guid + "'", "", 1, 1, "tb_msjw_sqjg", "ID", "");
        //                    if (ds.Tables[0].Rows.Count > 0)
        //                    {
        //                        replyContent = ds.Tables[0].Rows[0]["ZB_BLJG"].ToString();
        //                        replyName = ds.Tables[0].Rows[0]["ZB_BLRXM"].ToString();
        //                        replyTime = ds.Tables[0].Rows[0]["ZB_BLRQ"].ToString();
        //                        dtTbBstReportWire.Rows[i]["replycontent"] = replyContent;
        //                        dtTbBstReportWire.Rows[i]["replyname"] = replyName;
        //                        dtTbBstReportWire.Rows[i]["replytime"] = replyTime;
        //                    }
        //                }
        //                catch (Exception e)
        //                { }

        //                #endregion
        //            }
        //            mResultModel.data = dtTbBstReportWire;
        //        }
        //        else
        //        {
        //            mResultModel.result = "error";
        //            mResultModel.ErrorCode = -112;
        //        }
        //    }
        //    catch (Exception e)
        //    {
        //        mResultModel.result = "error";
        //    }
        //    IsoDateTimeConverter dtConverter = new IsoDateTimeConverter { DateTimeFormat = "yyyy-MM-dd HH:mm:ss" };
        //    HttpContext.Current.Response.Charset = "GB2312";
        //    HttpContext.Current.Response.ContentEncoding = System.Text.Encoding.GetEncoding("GB2312");
        //    var result = JsonUtils.ConvertJsonString(JsonConvert.SerializeObject(mResultModel, dtConverter));
        //    HttpContext.Current.Response.Write(callback + "(" + result + ")");
        //    var str = JsonConvert.SerializeObject(mResultModel, dtConverter);
        //    HttpContext.Current.Response.End();
        //}
        //#endregion
        #endregion

        #region 获取web客户端ip
        /// <summary>
        /// 获取web客户端ip
        /// </summary>
        /// <returns></returns>
        public static string GetWebClientIp()
        {

            string userIP = "未获取用户IP";

            try
            {
                if (System.Web.HttpContext.Current == null
            || System.Web.HttpContext.Current.Request == null
            || System.Web.HttpContext.Current.Request.ServerVariables == null)
                    return "";

                string CustomerIP = "";

                //CDN加速后取到的IP simone 090805
                CustomerIP = System.Web.HttpContext.Current.Request.Headers["Cdn-Src-Ip"];
                if (!string.IsNullOrEmpty(CustomerIP))
                {
                    return CustomerIP;
                }

                CustomerIP = System.Web.HttpContext.Current.Request.ServerVariables["HTTP_X_FORWARDED_FOR"];


                if (!String.IsNullOrEmpty(CustomerIP))
                    return CustomerIP;

                if (System.Web.HttpContext.Current.Request.ServerVariables["HTTP_VIA"] != null)
                {
                    CustomerIP = System.Web.HttpContext.Current.Request.ServerVariables["HTTP_X_FORWARDED_FOR"];
                    if (CustomerIP == null)
                        CustomerIP = System.Web.HttpContext.Current.Request.ServerVariables["REMOTE_ADDR"];
                }
                else
                {
                    CustomerIP = System.Web.HttpContext.Current.Request.ServerVariables["REMOTE_ADDR"];

                }

                if (string.Compare(CustomerIP, "unknown", true) == 0)
                    return System.Web.HttpContext.Current.Request.UserHostAddress;
                return CustomerIP;
            }
            catch { }

            return userIP;

        }
        #endregion
    }
}